<?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[Mehrer Structs ablegen]]></title><description><![CDATA[<p>Ich bräuchte etwas womit ich mehrere Structs sammeln kann. In Java kann man da nen Vector nehmen oder ne ArrayList aber wie macht man das in C++!? Ich weiß auch nicht wieviele Structs es werden, also muss die Größe dynamisch sein...</p>
<p>MfG Baweg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/161686/mehrer-structs-ablegen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 21:41:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/161686.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Oct 2006 08:17:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:17:40 GMT]]></title><description><![CDATA[<p>Ich bräuchte etwas womit ich mehrere Structs sammeln kann. In Java kann man da nen Vector nehmen oder ne ArrayList aber wie macht man das in C++!? Ich weiß auch nicht wieviele Structs es werden, also muss die Größe dynamisch sein...</p>
<p>MfG Baweg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151994</guid><dc:creator><![CDATA[Baweg]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:17:40 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:19:42 GMT]]></title><description><![CDATA[<p>std::vector</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151998</guid><dc:creator><![CDATA[Z2]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:19:42 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:20:21 GMT]]></title><description><![CDATA[<p>In C++ gibts auch vector <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
std::vector im Header &lt;vector&gt;<br />
Schau mal in der Referenz nach oder im Artikel zur stl hier im Forum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1151999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1151999</guid><dc:creator><![CDATA[THX 1138]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:20:21 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:21:13 GMT]]></title><description><![CDATA[<p>ich denke das geht wie in java. in c++ kannste auch 'nen vector nehmen wenn die structs alle von einer basisklasse abstammen (was ja bei java immer so ist).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1152000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152000</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:21:13 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:22:33 GMT]]></title><description><![CDATA[<p>Du könntest STL-Container verwenden (std::queue, std::vector, ...). Solltest du unterschiedliche Strukturen haben, kapsele sie am besten in einer Klasse, die von einer gemeinsamen Basis abgeleitet ist. Du kannst dann Zeiger auf die Basisklasse verwenden und sogar eine Methode einsetzen, um den Strukturtyp zu identifizieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1152001</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152001</guid><dc:creator><![CDATA[Sid2K6]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:22:33 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:39:01 GMT]]></title><description><![CDATA[<p>Is immer von der gleichen Struktur...<br />
Also wär vector da auch das richtige?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1152010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152010</guid><dc:creator><![CDATA[Baweg]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:39:01 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:41:44 GMT]]></title><description><![CDATA[<p>Perfekt</p>
<pre><code class="language-cpp">std::vector&lt;NameDeinerStruct&gt; nameDeinesVectors
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1152012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152012</guid><dc:creator><![CDATA[THX 1138]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:41:44 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:48:58 GMT]]></title><description><![CDATA[<p>Ok also reinschreiben scheint zu klappen...<br />
Wie lese ichd as nun aus?<br />
Mein struct heißt EntityState.<br />
Es gibt dort zB die Eigenschaft name.</p>
<p>In Java würd ichs fürs 1. Feld so machen: ((EntityState)vector.get(0)).name<br />
Ich habe jetzt in C++ folgendes probiert: ((EntityState)vector[0]).name</p>
<p>So scheints aber net zu gehen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1152018</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152018</guid><dc:creator><![CDATA[Baweg]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:48:58 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 08:52:35 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">EntityState[0].name;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1152024</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152024</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Tue, 10 Oct 2006 08:52:35 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 09:02:46 GMT]]></title><description><![CDATA[<pre><code>// vector anlegen
 std::vector&lt;EntityState&gt; vec;

 // zwei objecte da rein
 EntityState x1;
 EntityState x2;
 vec.push_back(x1);
 vec.push_back(x2);
</code></pre>
<p>auf die objekte kannste dann z.b. so zugreifen</p>
<pre><code>vec[0].name   // == x1.name
vec[1].name   // == x2.name
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1152032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152032</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Tue, 10 Oct 2006 09:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to Mehrer Structs ablegen on Tue, 10 Oct 2006 09:05:21 GMT]]></title><description><![CDATA[<p>Ah stimmt Datentyp kennt er ja...so läufts danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1152038</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1152038</guid><dc:creator><![CDATA[Baweg]]></dc:creator><pubDate>Tue, 10 Oct 2006 09:05:21 GMT</pubDate></item></channel></rss>