<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem mit 2D-Array als Parameterübergabe, help!]]></title><description><![CDATA[<p>Tag,<br />
ich habe hier folgendes:</p>
<pre><code class="language-cpp">char szBarricades[ 4 ][ 90 ];

    // ***** Save current barricades *****
    field-&gt;GetCurrentBarricades( szBarricades );

    // ***** [ ... ] *****

    // ***** Redraw old barricades *****
    field-&gt;DrawOldBarricades( &amp;szBarricades[ 90 ] );
</code></pre>
<p>GetCurrentBarricades - Funktion:</p>
<pre><code class="language-cpp">void CField::GetCurrentBarricades( char szBarricades[ 4 ][ 90 ] ) {

    for( int y = 0; y &lt; 4; y++ ) {

        for( int x = 0; x &lt; 90; x++ ) {

            if( GetFieldSymbol( x, y + 32 ) == '|' ) {

                szBarricades[ y ][ x ] = ' ';
            }
            else {

                szBarricades[ y ][ x ] = GetFieldSymbol( x, y + 32 );
            }
	    }        
    }   
}
</code></pre>
<p>DrawOldBarricades - Funktion:</p>
<pre><code class="language-cpp">void CField::DrawOldBarricades( char szBarricades[ 4 ][ 90 ] ) {

    for( int y = 0; y &lt; 4; y++ ) {

	    for( int x = 0; x &lt; 90; x++ ) {

            switch( szBarricades[ y ][ x ] ) { // &lt;== Hier krachts !!!

			    case  -1: { SetField( x, y + 32, EMPTY, szBarricades[ y ][ x ] ); break; }
                case -37: { SetField( x, y + 32, BARRICADES4, szBarricades[ y ][ x ] ); break; }
                case -78: { SetField( x, y + 32, BARRICADES3, szBarricades[ y ][ x ] ); break; }
                case -79: { SetField( x, y + 32, BARRICADES2, szBarricades[ y ][ x ] ); break; }
                case -80: { SetField( x, y + 32, BARRICADES1, szBarricades[ y ][ x ] ); break; }
            }
	    }        
    } 
}
</code></pre>
<p>Allerdings sagt mir der Debuuger dann, das er das Array nicht lesen kann<br />
( Zeile 7 [ Zweite Fkt.] ). Hm hat einer Idee?</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/212291/problem-mit-2d-array-als-parameterübergabe-help</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 16:43:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/212291.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 May 2008 11:29:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 11:29:15 GMT]]></title><description><![CDATA[<p>Tag,<br />
ich habe hier folgendes:</p>
<pre><code class="language-cpp">char szBarricades[ 4 ][ 90 ];

    // ***** Save current barricades *****
    field-&gt;GetCurrentBarricades( szBarricades );

    // ***** [ ... ] *****

    // ***** Redraw old barricades *****
    field-&gt;DrawOldBarricades( &amp;szBarricades[ 90 ] );
</code></pre>
<p>GetCurrentBarricades - Funktion:</p>
<pre><code class="language-cpp">void CField::GetCurrentBarricades( char szBarricades[ 4 ][ 90 ] ) {

    for( int y = 0; y &lt; 4; y++ ) {

        for( int x = 0; x &lt; 90; x++ ) {

            if( GetFieldSymbol( x, y + 32 ) == '|' ) {

                szBarricades[ y ][ x ] = ' ';
            }
            else {

                szBarricades[ y ][ x ] = GetFieldSymbol( x, y + 32 );
            }
	    }        
    }   
}
</code></pre>
<p>DrawOldBarricades - Funktion:</p>
<pre><code class="language-cpp">void CField::DrawOldBarricades( char szBarricades[ 4 ][ 90 ] ) {

    for( int y = 0; y &lt; 4; y++ ) {

	    for( int x = 0; x &lt; 90; x++ ) {

            switch( szBarricades[ y ][ x ] ) { // &lt;== Hier krachts !!!

			    case  -1: { SetField( x, y + 32, EMPTY, szBarricades[ y ][ x ] ); break; }
                case -37: { SetField( x, y + 32, BARRICADES4, szBarricades[ y ][ x ] ); break; }
                case -78: { SetField( x, y + 32, BARRICADES3, szBarricades[ y ][ x ] ); break; }
                case -79: { SetField( x, y + 32, BARRICADES2, szBarricades[ y ][ x ] ); break; }
                case -80: { SetField( x, y + 32, BARRICADES1, szBarricades[ y ][ x ] ); break; }
            }
	    }        
    } 
}
</code></pre>
<p>Allerdings sagt mir der Debuuger dann, das er das Array nicht lesen kann<br />
( Zeile 7 [ Zweite Fkt.] ). Hm hat einer Idee?</p>
<p>Gruß Tobi.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503002</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 04 May 2008 11:29:15 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 13:33:12 GMT]]></title><description><![CDATA[<p>Hehe</p>
<pre><code class="language-cpp">char szBarricades[ 4 ][ 90 ];
</code></pre>
<p>Ist in dem Fall ein Zeiger auf den Beginn einer array mit zeigern auf char-arrays..</p>
<p>Die Funktion muss also so aussehen:</p>
<pre><code class="language-cpp">void CField::GetCurrentBarricades( char **szBarricades ) {

    for( int y = 0; y &lt; 4; y++ ) {

        for( int x = 0; x &lt; 90; x++ ) {

            if( GetFieldSymbol( x, y + 32 ) == '|' ) {

                szBarricades[ y ][ x ] = ' ';
            }
            else {

                szBarricades[ y ][ x ] = GetFieldSymbol( x, y + 32 );
            }
        }        
    }   
}
</code></pre>
<p>Hoffe ich zumindest <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503093</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503093</guid><dc:creator><![CDATA[DataByte]]></dc:creator><pubDate>Sun, 04 May 2008 13:33:12 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 13:38:47 GMT]]></title><description><![CDATA[<p>DataByte schrieb:</p>
<blockquote>
<p>Hehe</p>
<pre><code class="language-cpp">char szBarricades[ 4 ][ 90 ];
</code></pre>
<p>Ist in dem Fall ein Zeiger auf den Beginn einer array mit zeigern auf char-arrays..</p>
</blockquote>
<p>Unfug.</p>
<p>Nebenbei enthält Zeile 9 des ersten Codeschnipsels einen Fehler.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503097</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503097</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sun, 04 May 2008 13:38:47 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 14:18:29 GMT]]></title><description><![CDATA[<p>Jo konnt ich mir schon denken, aber das war des einzige was dr Compi gefressen hat... wie muss ich das da schreiben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503111</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 04 May 2008 14:18:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 14:20:40 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>Jo konnt ich mir schon denken, aber das war des einzige was dr Compi gefressen hat... wie muss ich das da schreiben?</p>
</blockquote>
<p>Dia Antwort steht schon da.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503112</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sun, 04 May 2008 14:20:40 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 14:21:55 GMT]]></title><description><![CDATA[<p>Wie die Antwort steht schon da? Du hast mich doch nur noch mal bestätigt das Zeile 9 falsch ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503114</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 04 May 2008 14:21:55 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 14:31:19 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>Wie die Antwort steht schon da? Du hast mich doch nur noch mal bestätigt das Zeile 9 falsch ist?</p>
</blockquote>
<p>irgendwo auf dieser Seite ist auch ein korrekter Aufruf zu finden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503115</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sun, 04 May 2008 14:31:19 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 14:36:52 GMT]]></title><description><![CDATA[<p>Entshculdige aber ich fühl mich gerade einwenig verarscht, wenn er hier stehen solte, kannst du ihn net einfach noch mal marken reposten oder k.A., weil ich ihn nicht sehe, ausser mein eigenen Aufruf der ja falsch ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503118</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 04 May 2008 14:36:52 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 14:48:18 GMT]]></title><description><![CDATA[<p>T0bi schrieb:</p>
<blockquote>
<p>Entshculdige aber ich fühl mich gerade einwenig verarscht, wenn er hier stehen solte, kannst du ihn net einfach noch mal marken reposten oder k.A., weil ich ihn nicht sehe, ausser mein eigenen Aufruf der ja falsch ist.</p>
</blockquote>
<p>Grausame Welt ...</p>
<p>GetCurrentBarricades hast du nicht selbst gemacht, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503122</guid><dc:creator><![CDATA[Engel Gabriel]]></dc:creator><pubDate>Sun, 04 May 2008 14:48:18 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit 2D-Array als Parameterübergabe, help! on Sun, 04 May 2008 15:05:40 GMT]]></title><description><![CDATA[<p>Doch <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f623.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--persevering_face"
      title="&gt;.&lt;"
      alt="😣"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1503134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1503134</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Sun, 04 May 2008 15:05:40 GMT</pubDate></item></channel></rss>