<?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 Arrayzeiger]]></title><description><![CDATA[<p>Hi !</p>
<p>Ich will folgendes machen:</p>
<pre><code class="language-cpp">//hier fängt die Methode an...    
int mix_matrix[vector_dimension][number_of_patches]; //column vector merged in a matrix

//mach hier was...

return mix_matrix;
</code></pre>
<p>Als Fehler erhalte ich in der Konsole:</p>
<pre><code>g++ -c -pipe -fno-strict-aliasing -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I. -o PatchGenerator.o PatchGenerator.cpp
PatchGenerator.cpp: In member function ‘int* PatchGenerator::transform_patches_to_vectors_and_merge_to_matrix(std::vector&lt;QImage*, std::allocator&lt;QImage*&gt; &gt;*, int)’:
PatchGenerator.cpp:26: error: cannot convert ‘int (*)[(((unsigned int)(((int)vector_dimension) - 1)) + 1u)][(((unsigned int)(((int)number_of_patches) - 1)) + 1u)]’ to ‘int*’ in return
make: *** [PatchGenerator.o] Fehler 1
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/148520/problem-mit-arrayzeiger</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 21:12:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148520.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 May 2006 16:00:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 16:00:39 GMT]]></title><description><![CDATA[<p>Hi !</p>
<p>Ich will folgendes machen:</p>
<pre><code class="language-cpp">//hier fängt die Methode an...    
int mix_matrix[vector_dimension][number_of_patches]; //column vector merged in a matrix

//mach hier was...

return mix_matrix;
</code></pre>
<p>Als Fehler erhalte ich in der Konsole:</p>
<pre><code>g++ -c -pipe -fno-strict-aliasing -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I. -o PatchGenerator.o PatchGenerator.cpp
PatchGenerator.cpp: In member function ‘int* PatchGenerator::transform_patches_to_vectors_and_merge_to_matrix(std::vector&lt;QImage*, std::allocator&lt;QImage*&gt; &gt;*, int)’:
PatchGenerator.cpp:26: error: cannot convert ‘int (*)[(((unsigned int)(((int)vector_dimension) - 1)) + 1u)][(((unsigned int)(((int)number_of_patches) - 1)) + 1u)]’ to ‘int*’ in return
make: *** [PatchGenerator.o] Fehler 1
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1066190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066190</guid><dc:creator><![CDATA[tomtenta]]></dc:creator><pubDate>Sat, 27 May 2006 16:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 16:02:17 GMT]]></title><description><![CDATA[<p>Hier ist der Methodenheader:</p>
<pre><code class="language-cpp">int* PatchGenerator::transform_patches_to_vectors_and_merge_to_matrix( vector&lt;QImage*&gt;* patches , int rect_size ) {
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1066191</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066191</guid><dc:creator><![CDATA[tomtenta]]></dc:creator><pubDate>Sat, 27 May 2006 16:02:17 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 16:10:47 GMT]]></title><description><![CDATA[<p>mix_matrix ist vom Typ int**, du willst aber einen int* zurückgeben...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066208</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066208</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Sat, 27 May 2006 16:10:47 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 16:20:06 GMT]]></title><description><![CDATA[<p>Stimmt, jetzt hab ich es mal geändert:</p>
<pre><code class="language-cpp">int** PatchGenerator::transform_patches_to_vectors_and_merge_to_matrix( vector&lt;QImage*&gt;* patches , int rect_size ) {

    int mix_matrix[vector_dimension][number_of_patches]; //column vector merge in a matrix
//mach hier was....

    return mix_matrix;
}
</code></pre>
<p>Ich erhalte wieder den Fehler:</p>
<pre><code>PatchGenerator.cpp: In member function ‘int** PatchGenerator::transform_patches_to_vectors_and_merge_to_matrix(std::vector&lt;QImage*, std::allocator&lt;QImage*&gt; &gt;*, int)’:
PatchGenerator.cpp:22: error: cannot convert ‘int (*)[(((unsigned int)(((int)number_of_patches) - 1)) + 1u)]’ to ‘int**’ in return
make: *** [PatchGenerator.o] Fehler 1
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1066218</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066218</guid><dc:creator><![CDATA[tomtenta]]></dc:creator><pubDate>Sat, 27 May 2006 16:20:06 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 16:29:21 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Also auf deine Art kannst du kein dynamisches Array anlegen.<br />
<div class="plugin-markdown"><input type="checkbox" id="checkbox120939" checked="true" /><label for="checkbox120939">machst muss x eine Konstante sein, was hier nich der Fall ist wie es ausieht.</label></div></p>
<p>Mach es so:</p>
<p>int* a;<br />
a = new int[x]; jetzt kann x auch eine Variable sein.</p>
<p>Problem ist nur du kannst nicht:</p>
<p>int** a;<br />
a = new int[x][y]; machen.</p>
<p>Ich hab das mal so gelöst gehabt, aber ka mehr ob das ging^^:</p>
<p>int *<em>a;<br />
a = new int</em>[x];<br />
for(int i=0;i&lt;x;i++)<br />
{<br />
a[i] = new int[y];<br />
}</p>
<p>Kannst ja mal probieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066231</guid><dc:creator><![CDATA[Sleepy-01]]></dc:creator><pubDate>Sat, 27 May 2006 16:29:21 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 17:40:43 GMT]]></title><description><![CDATA[<p>Nein das geht so leider nicht...</p>
<pre><code class="language-cpp">//zwar geht:
int** mix_matrix = new int*[vector_dimension];
//das geht aber nicht:
for( unsigned int matrix_column = 0 ; matrix_column &lt; patches-&gt;size() ; matrix_column++ ) 
      mix_matrix[matrix_column] = new int[gewuenschte_groesse];
</code></pre>
<pre><code>PatchGenerator.cpp:21: error: name lookup of ‘matrix_column’ changed for new ISO ‘for’ scoping
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1066298</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066298</guid><dc:creator><![CDATA[tomtenta]]></dc:creator><pubDate>Sat, 27 May 2006 17:40:43 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Arrayzeiger on Sat, 27 May 2006 18:01:16 GMT]]></title><description><![CDATA[<p>Okay ich habs so gelöst:</p>
<pre><code class="language-cpp">int** PatchGenerator::transform_patches_to_vectors_and_merge_to_matrix( vector&lt;QImage*&gt;* patches , int rect_size ) {
    int vector_dimension = rect_size * rect_size;
    int number_of_patches = patches-&gt;size();
    int** mix_matrix = new int*[number_of_patches];

    for( unsigned int matrix_column = 0 ; matrix_column &lt; patches-&gt;size() ; matrix_column++ ) {
        int* vector = new int[vector_dimension];
        for( int x = 0 ; x &lt; rect_size ; ++x ) 
            for( int y = 0 ; y &lt; rect_size ; ++y ) 
                vector[ x * rect_size + y ] = patches-&gt;at( matrix_column )-&gt;pixel( x , y );
        mix_matrix[ matrix_column ] = vector;
    }
    return mix_matrix;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1066315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066315</guid><dc:creator><![CDATA[tomtenta]]></dc:creator><pubDate>Sat, 27 May 2006 18:01:16 GMT</pubDate></item></channel></rss>