<?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[Vector frage]]></title><description><![CDATA[<p>Ich hab diese Seite über Vectoren gefunden und verstehe etwas nicht:<br />
<a href="http://de.wikibooks.org/wiki/C++-Programmierung:_Vector" rel="nofollow">http://de.wikibooks.org/wiki/C++-Programmierung:_Vector</a></p>
<p>einer Zeile steht ++v[i];, und ich verseh nicht was die bedeutet. ich kenn i++ aber was macht dann diese Zeile?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/309306/vector-frage</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 18:59:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/309306.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Oct 2012 10:14:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 10:14:33 GMT]]></title><description><![CDATA[<p>Ich hab diese Seite über Vectoren gefunden und verstehe etwas nicht:<br />
<a href="http://de.wikibooks.org/wiki/C++-Programmierung:_Vector" rel="nofollow">http://de.wikibooks.org/wiki/C++-Programmierung:_Vector</a></p>
<p>einer Zeile steht ++v[i];, und ich verseh nicht was die bedeutet. ich kenn i++ aber was macht dann diese Zeile?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261996</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261996</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Fri, 19 Oct 2012 10:14:33 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 10:36:39 GMT]]></title><description><![CDATA[<p>alterbro schrieb:</p>
<blockquote>
<p>einer Zeile steht ++v[i];, und ich verseh nicht was die bedeutet. ich kenn i++ aber was macht dann diese Zeile?</p>
</blockquote>
<p>Ok, wie geht man da am Besten vor? So:</p>
<ol>
<li><code>v</code> ist ein Bezeichner/Name, in diesem Fall für einen <code>std::vector</code> .</li>
</ol>
<p>2. Links und rechts vom Bezeichner steht jeweils ein Operator. Wir werfen einen Blick in die <a href="http://en.cppreference.com/w/cpp/language/operator_precedence" rel="nofollow">Operator Precedence Tabelle</a>. Wir sehen, dass der operator[] (Array subscripting) stärker bindet, als der Prefix-Increment-Operator (++).</p>
<p>3. D.h. als erstes gibt uns <code>v[i]</code> eine Referenz auf das i-te Element des Vectors <code>v</code> zurück. (Das sehen wir <a href="http://www.cplusplus.com/reference/stl/vector/operator%5B%5D/" rel="nofollow">hier</a>)</p>
<p>4. Als zweites wird der Wert des i-te Elements mit dem Prefix-Increment-Operator um 1 erhöht. (da inkrement)</p>
<p>Fazit: Der Wert des i-ten Elements des Vectors <code>v</code> wird um 1 erhöht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262007</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262007</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Fri, 19 Oct 2012 10:36:39 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 11:48:37 GMT]]></title><description><![CDATA[<p>ok, danke, jetzt machts auch sinn.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262048</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Fri, 19 Oct 2012 11:48:37 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 17:31:26 GMT]]></title><description><![CDATA[<p>ich hab noch ne frage:<br />
kann man mehrere vectoren zu einem grossen verbinden, bzw. hinzufügen?<br />
Ich weiss, das ging mit einer Schleife, aber das muss wärend des Programms sehr oft gemacht werden, und vielleicht gibts dafür ja eine sehr schnelle natice funtion?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262128</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Fri, 19 Oct 2012 17:31:26 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 17:44:12 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">for( auto iter : v1 )
{
    v2.push_back( iter );
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2262133</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262133</guid><dc:creator><![CDATA[offget]]></dc:creator><pubDate>Fri, 19 Oct 2012 17:44:12 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 17:50:14 GMT]]></title><description><![CDATA[<p>ok, danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262135</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Fri, 19 Oct 2012 17:50:14 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Fri, 19 Oct 2012 18:01:09 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::vector&lt;int&gt; v1 = { 1, 2, 3, 4, 5 };
std::vector&lt;int&gt; v2 = { 6, 7, 8, 9, 10 };
v1.insert(v1.end(), v2.begin(), v2.end());
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2262138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262138</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Fri, 19 Oct 2012 18:01:09 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Sat, 20 Oct 2012 14:38:18 GMT]]></title><description><![CDATA[<p>offget schrieb:</p>
<blockquote>
<pre><code class="language-cpp">for( auto iter : v1 )
{
    v2.push_back( iter );
}
</code></pre>
</blockquote>
<p>Der Nachteil bei dieser <s>Funktion</s> Methode ist außerdem noch, dass man die Objekte zweimal kopiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262140</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 20 Oct 2012 14:38:18 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Sat, 20 Oct 2012 12:36:38 GMT]]></title><description><![CDATA[<p>super, danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262293</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Sat, 20 Oct 2012 12:36:38 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Mon, 22 Oct 2012 12:49:40 GMT]]></title><description><![CDATA[<p>offget schrieb:</p>
<blockquote>
<pre><code class="language-cpp">for( auto iter : v1 )
{
    v2.push_back( iter );
}
</code></pre>
</blockquote>
<p>Außerdem kann es passieren, dass <code>v2</code> seinen Speicher mehrere Male reallokieren muss. Ethons hat´s richtig gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262851</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Mon, 22 Oct 2012 12:49:40 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:31:21 GMT]]></title><description><![CDATA[<p>etwas möchte ich noch wissen:<br />
erstellt ein Vector eine Kopie der Objekte oder einen Zeiger darauf?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263228</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263228</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:31:21 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:34:14 GMT]]></title><description><![CDATA[<p>Kopien.</p>
<p>Wenn es möglich ist, darf ein Objekt auch gemoved werden, aber das ist ein Implementierungsdetails - für dich als Vectornutzer sieht es trotzdem wie eine Kopie aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263230</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:34:14 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:35:40 GMT]]></title><description><![CDATA[<p>danke, aber kann man einen vector auch für einen Zeiger verwenden?<br />
UNd wenn ja wie?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263231</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263231</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:35:40 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:37:14 GMT]]></title><description><![CDATA[<p>alterbro schrieb:</p>
<blockquote>
<p>kann man einen vector auch für einen Zeiger verwenden?</p>
</blockquote>
<p>klar</p>
<p>edit: zum &quot;wie&quot;:</p>
<pre><code class="language-cpp">std::vector&lt;MyClass*&gt; myvec;

MyClass* myClassPointer = GetMyClassPointer();  // irgendwie einen Pointer holen/erzeugen

myvec.push_back(myClassPointer);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2263232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263232</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:37:14 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:36:02 GMT]]></title><description><![CDATA[<p>und wie?<br />
Irgendwie schaf ichs nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263233</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:36:02 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:37:53 GMT]]></title><description><![CDATA[<p>alterbro schrieb:</p>
<blockquote>
<p>und wie?<br />
Irgendwie schaf ichs nicht.</p>
</blockquote>
<p>wenn dir mein Beispiel nicht reicht, musst du wohl mal Code zeigen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263235</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:37:53 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:40:01 GMT]]></title><description><![CDATA[<p>naja,dass</p>
<pre><code class="language-cpp">static std::vector&lt;*texture&gt; texptr;
</code></pre>
<p>funktioniert nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263237</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:40:01 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:44:18 GMT]]></title><description><![CDATA[<p>Es muss ja auch</p>
<pre><code class="language-cpp">static std::vector&lt;texture *&gt; texptr;
</code></pre>
<p>heißen.</p>
<p>Edit: Merk dir bitte für die Zukunft: &quot;funktioniert nicht&quot; ist keine Fehlermeldung, mit der man viel anfangen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263238</guid><dc:creator><![CDATA[*Rewind*]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:44:18 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:44:17 GMT]]></title><description><![CDATA[<p>alterbro schrieb:</p>
<blockquote>
<p>funktioniert nicht</p>
</blockquote>
<p>Ich sollte mal nman fragen, ob er einen Filter für das Forum bauen kann, der Beiträge mit dieser Problembeschreibung automatisch verbietet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263239</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:44:17 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:54:34 GMT]]></title><description><![CDATA[<p>sorry, es gibt diesen compilerfehler</p>
<p>/home/marvin/Prog/actprojects/DustRider/machine/../tools/geo/../../tools/geo/../../tools/texture/texture.h|18|Fehler: »*« kann nicht in einem Konstanten-Ausdruck auftreten|</p>
<p>ok, danke scheint zu funktionieren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263242</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:54:34 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Tue, 23 Oct 2012 13:52:53 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>alterbro schrieb:</p>
<blockquote>
<p>funktioniert nicht</p>
</blockquote>
<p>Ich sollte mal nman fragen, ob er einen Filter für das Forum bauen kann, der Beiträge mit dieser Problembeschreibung automatisch verbietet.</p>
</blockquote>
<p>Das ist aber insofern schwierig, weil ja nach dem &quot;funktioniert nicht&quot; auch durchaus eine genauere Fehlerbeschreibung folgen kann.</p>
<p>Es wäre also evtl. sinnvoll eine Abfrage ähnlich dem Spambuster anzuzeigen:</p>
<blockquote>
<p>Ihr Beitrag enthält den Text &quot;funktioniert nicht&quot;. Wir haben die Erfahrung gemacht, dass neue Benutzer häufig keine ausreichende Fehlerbeschreibung angeben.</p>
<p>Überprüfen Sie Ihren Beitrag bitte daraufhin, ob folgende Kritieren erfüllt sind:<br />
...<br />
Angabe einer Fehlermeldung (z.B. vom Compiler)<br />
Bereitstellung des entsprechenden Codeausschnitts (Entsprechende Code Tags für C++, C#, usw. nutzen!)<br />
...</p>
<p><div class="plugin-markdown"><input type="checkbox" id="checkbox140505" checked="true" /><label for="checkbox140505">Mein Beitrag erfüllt die oben genannten Kriterien.</label></div></p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2263244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263244</guid><dc:creator><![CDATA[fghfghfgh]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:52:53 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Wed, 24 Oct 2012 17:33:50 GMT]]></title><description><![CDATA[<p>ich müsste doch noch etwas wissen: wie kann ich einen wert am Ende eines Vektors hinzufügen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263684</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Wed, 24 Oct 2012 17:33:50 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Wed, 24 Oct 2012 17:56:56 GMT]]></title><description><![CDATA[<p>alterbro schrieb:</p>
<blockquote>
<p>ich müsste doch noch etwas wissen: wie kann ich einen wert am Ende eines Vektors hinzufügen?</p>
</blockquote>
<p>Alles in der Referenz. Mit <code>push_back</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263690</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Wed, 24 Oct 2012 17:56:56 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Wed, 24 Oct 2012 18:29:42 GMT]]></title><description><![CDATA[<p>aber push back setzt es doch am amfang an, wie kann ich den wert vorn anfügen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263708</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263708</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Wed, 24 Oct 2012 18:29:42 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Wed, 24 Oct 2012 18:32:31 GMT]]></title><description><![CDATA[<p>alterbro schrieb:</p>
<blockquote>
<p>aber push back setzt es doch am amfang an, wie kann ich den wert vorn anfügen?</p>
</blockquote>
<p><code>push_back</code> fügt das Element hinten ein.<br />
<code>push_front</code> fügt das Element vorne ein.</p>
<p>Entscheide dich, du widersprichst dir hier gerade sehr deutlich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263710</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Wed, 24 Oct 2012 18:32:31 GMT</pubDate></item><item><title><![CDATA[Reply to Vector frage on Wed, 24 Oct 2012 18:36:03 GMT]]></title><description><![CDATA[<p>push_front exxistiert nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263713</guid><dc:creator><![CDATA[alterbro]]></dc:creator><pubDate>Wed, 24 Oct 2012 18:36:03 GMT</pubDate></item></channel></rss>