<?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[Frage zu Vector]]></title><description><![CDATA[<p>Moin!</p>
<p>Mein Buch hat ein Bsp das da lautet:</p>
<pre><code>int arr[] = {0,10,20,30};

for(int i = 0; i &lt; 4; i++)
{
    cout &lt;&lt; (void*)(arr + i) &lt;&lt; endl;
}
</code></pre>
<p>Wenn ich es so ausführe wie es dasteht, werden die Adressen korrekt ausgegeben.<br />
Ändere ich aber (arr + i) auf (arr[i]), so fängt die Adressierung bei 0 an. Also kann ich es so nicht schreiben. Hab ich da was verpasst, oder kann mir das einer erklären, warum ich das so schreiben muß. Denn im Grunde ist es doch das selbe, oder?</p>
<p>THX</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/73451/frage-zu-vector</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 13:41:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/73451.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 May 2004 13:38:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu Vector on Mon, 10 May 2004 13:38:09 GMT]]></title><description><![CDATA[<p>Moin!</p>
<p>Mein Buch hat ein Bsp das da lautet:</p>
<pre><code>int arr[] = {0,10,20,30};

for(int i = 0; i &lt; 4; i++)
{
    cout &lt;&lt; (void*)(arr + i) &lt;&lt; endl;
}
</code></pre>
<p>Wenn ich es so ausführe wie es dasteht, werden die Adressen korrekt ausgegeben.<br />
Ändere ich aber (arr + i) auf (arr[i]), so fängt die Adressierung bei 0 an. Also kann ich es so nicht schreiben. Hab ich da was verpasst, oder kann mir das einer erklären, warum ich das so schreiben muß. Denn im Grunde ist es doch das selbe, oder?</p>
<p>THX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/517587</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/517587</guid><dc:creator><![CDATA[VirtualDreams]]></dc:creator><pubDate>Mon, 10 May 2004 13:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Vector on Mon, 10 May 2004 13:45:46 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>bei array[i] wird der Zeige bereits dereferenziert und dir wird der Inhalt an<br />
der Speicheradresse (array + i) ausgegeben. array[i] ist die andere Schreibweise<br />
fuer *(array + i). Willst du die Adresse haben, musst du &amp;array[i] schreiben.</p>
<p>mfg<br />
v R</p>
]]></description><link>https://www.c-plusplus.net/forum/post/517594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/517594</guid><dc:creator><![CDATA[virtuell Realisticer]]></dc:creator><pubDate>Mon, 10 May 2004 13:45:46 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu Vector on Mon, 10 May 2004 13:53:22 GMT]]></title><description><![CDATA[<p>Danke, das mit &amp; davor vergas ich irgendwie...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/517607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/517607</guid><dc:creator><![CDATA[VirtualDreams]]></dc:creator><pubDate>Mon, 10 May 2004 13:53:22 GMT</pubDate></item></channel></rss>