<?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[If-Abfrage mit Arrays]]></title><description><![CDATA[<p>long arr2d[3][3] = { { 0,1,2 },{ 3,4,5 },{ 6,7,8 } };<br />
long arr2d2[3][3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };</p>
<p>if (&amp;arr2d == &amp;arr2d2);<br />
cout &lt;&lt; &quot;true&quot; &lt;&lt; endl; // Wird ausgegeben</p>
<p>if (arr2d == arr2d2);<br />
cout &lt;&lt; &quot;true&quot; &lt;&lt; endl; // Wird ausgegeben</p>
<p>int a=0, b=1;</p>
<p>if (&amp;a == &amp;b)<br />
cout &lt;&lt; &quot; true as well&quot; &lt;&lt; endl; // Wird nicht ausgegeben</p>
<p>Hallo,</p>
<p>ich verstehe nicht wieso bei den zwei oberen Fällen, bei denen die Adressen der arrays verglichen werden die If-Bedingung erfüllt ist, wobei die arrays offensichtlich zwei unterschiedliche Adresse haben. Da das bei arrays gegen mein Verständnis schon funktioniert, habe ich weiter das Problem, wieso es dann bei integer-Variablen nicht funktioniert. Würde mich sehr freuen, wenn mir jemand erklären kann, was hier passiert.</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/339078/if-abfrage-mit-arrays</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 16:39:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/339078.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Aug 2016 13:05:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to If-Abfrage mit Arrays on Mon, 01 Aug 2016 13:05:31 GMT]]></title><description><![CDATA[<p>long arr2d[3][3] = { { 0,1,2 },{ 3,4,5 },{ 6,7,8 } };<br />
long arr2d2[3][3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };</p>
<p>if (&amp;arr2d == &amp;arr2d2);<br />
cout &lt;&lt; &quot;true&quot; &lt;&lt; endl; // Wird ausgegeben</p>
<p>if (arr2d == arr2d2);<br />
cout &lt;&lt; &quot;true&quot; &lt;&lt; endl; // Wird ausgegeben</p>
<p>int a=0, b=1;</p>
<p>if (&amp;a == &amp;b)<br />
cout &lt;&lt; &quot; true as well&quot; &lt;&lt; endl; // Wird nicht ausgegeben</p>
<p>Hallo,</p>
<p>ich verstehe nicht wieso bei den zwei oberen Fällen, bei denen die Adressen der arrays verglichen werden die If-Bedingung erfüllt ist, wobei die arrays offensichtlich zwei unterschiedliche Adresse haben. Da das bei arrays gegen mein Verständnis schon funktioniert, habe ich weiter das Problem, wieso es dann bei integer-Variablen nicht funktioniert. Würde mich sehr freuen, wenn mir jemand erklären kann, was hier passiert.</p>
<p>Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2504227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2504227</guid><dc:creator><![CDATA[Erano1]]></dc:creator><pubDate>Mon, 01 Aug 2016 13:05:31 GMT</pubDate></item><item><title><![CDATA[Reply to If-Abfrage mit Arrays on Mon, 01 Aug 2016 13:13:57 GMT]]></title><description><![CDATA[<p>Erano1 schrieb:</p>
<blockquote>
<p>long arr2d[3][3] = { { 0,1,2 },{ 3,4,5 },{ 6,7,8 } };<br />
long arr2d2[3][3] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };</p>
<p>if (&amp;arr2d == &amp;arr2d2);<br />
cout &lt;&lt; &quot;true&quot; &lt;&lt; endl; // Wird ausgegeben</p>
<p>if (arr2d == arr2d2);<br />
cout &lt;&lt; &quot;true&quot; &lt;&lt; endl; // Wird ausgegeben</p>
<p>int a=0, b=1;</p>
<p>if (&amp;a == &amp;b)<br />
cout &lt;&lt; &quot; true as well&quot; &lt;&lt; endl; // Wird nicht ausgegeben</p>
<p>Hallo,</p>
<p>ich verstehe nicht wieso bei den zwei oberen Fällen, bei denen die Adressen der arrays verglichen werden die If-Bedingung erfüllt ist, wobei die arrays offensichtlich zwei unterschiedliche Adresse haben.</p>
</blockquote>
<p>Das liegt an dem Semikolon am Ende der Zeile, die mit if ... beginnt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2504228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2504228</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Mon, 01 Aug 2016 13:13:57 GMT</pubDate></item><item><title><![CDATA[Reply to If-Abfrage mit Arrays on Mon, 01 Aug 2016 15:31:11 GMT]]></title><description><![CDATA[<p>Was ein Fehler...vielen Dank!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2504257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2504257</guid><dc:creator><![CDATA[Erano1]]></dc:creator><pubDate>Mon, 01 Aug 2016 15:31:11 GMT</pubDate></item></channel></rss>