<?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[array Frage]]></title><description><![CDATA[<p>Hi,<br />
ich habe mal eine Frage zu arrays. Und zwar habe ich zu einer Funktion folgendes Beispiel gefunden:</p>
<pre><code>const wxString choices[] = { _T(&quot;One&quot;), _T(&quot;Two&quot;), _T(&quot;Three&quot;)} ;
//wxSingleChoiceDialog(..., const wxString* choices,...);
wxSingleChoiceDialog(...,choices,...);
</code></pre>
<p>Hab das ganze mal aufs wesentliche gekürzt.<br />
Nun möchte ich anstatt dem Array &quot;choices&quot; ein dynamisches Array verwenden, hab aber keine Ahnung wie ich das machen soll. Geht das vielleicht mit std::vector irgendwie? Hab jetzt schon etliche Stunden rumprobiert, aber nichts hinbekommen.<br />
Ich hoffe ihr könnt mir helfen.</p>
<p>Gruß<br />
Peter</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/121071/array-frage</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 14:47:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/121071.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Sep 2005 15:20:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to array Frage on Mon, 19 Sep 2005 15:20:29 GMT]]></title><description><![CDATA[<p>Hi,<br />
ich habe mal eine Frage zu arrays. Und zwar habe ich zu einer Funktion folgendes Beispiel gefunden:</p>
<pre><code>const wxString choices[] = { _T(&quot;One&quot;), _T(&quot;Two&quot;), _T(&quot;Three&quot;)} ;
//wxSingleChoiceDialog(..., const wxString* choices,...);
wxSingleChoiceDialog(...,choices,...);
</code></pre>
<p>Hab das ganze mal aufs wesentliche gekürzt.<br />
Nun möchte ich anstatt dem Array &quot;choices&quot; ein dynamisches Array verwenden, hab aber keine Ahnung wie ich das machen soll. Geht das vielleicht mit std::vector irgendwie? Hab jetzt schon etliche Stunden rumprobiert, aber nichts hinbekommen.<br />
Ich hoffe ihr könnt mir helfen.</p>
<p>Gruß<br />
Peter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/875874</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/875874</guid><dc:creator><![CDATA[Peter567]]></dc:creator><pubDate>Mon, 19 Sep 2005 15:20:29 GMT</pubDate></item><item><title><![CDATA[Reply to array Frage on Mon, 19 Sep 2005 15:24:41 GMT]]></title><description><![CDATA[<p><a href="http://cplus.kompf.de/artikel/container.html" rel="nofollow">http://cplus.kompf.de/artikel/container.html</a></p>
<pre><code class="language-cpp">std::vector&lt;wxString&gt; a;
a.push_back(&quot;one&quot;);
a.push_back(&quot;two&quot;);
// ...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/875881</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/875881</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Mon, 19 Sep 2005 15:24:41 GMT</pubDate></item><item><title><![CDATA[Reply to array Frage on Mon, 19 Sep 2005 15:31:04 GMT]]></title><description><![CDATA[<p>miller_m schrieb:</p>
<blockquote>
<p><a href="http://cplus.kompf.de/artikel/container.html" rel="nofollow">http://cplus.kompf.de/artikel/container.html</a></p>
<pre><code class="language-cpp">std::vector&lt;wxString&gt; a;
a.push_back(&quot;one&quot;);
a.push_back(&quot;two&quot;);
// ...
</code></pre>
</blockquote>
<p>Ja, soweit bin ich auch noch gekommen, aber wie muss ich diesen Vector der Funktion übergeben? So erhalte ich folgende Fehlermeldung:</p>
<p>Konvertierung des Parameters 5 von 'std::vector&lt;_Ty&gt;' in 'const wxString *' nicht möglich</p>
]]></description><link>https://www.c-plusplus.net/forum/post/875885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/875885</guid><dc:creator><![CDATA[Peter567]]></dc:creator><pubDate>Mon, 19 Sep 2005 15:31:04 GMT</pubDate></item><item><title><![CDATA[Reply to array Frage on Mon, 19 Sep 2005 15:33:50 GMT]]></title><description><![CDATA[<p>&amp;myVector[0] gibt die Adresse des erstens Elements an. Bei Vectoren ist garantiert dass sich alle Elemente am Stück im Speicher befinden, allerdings wird der Speicher ungültig wenn der Speicher intern reallokiert wird. Das kann bei Operationen wie push_back (und auch andere bei denen Elemente eingefügt werden) passieren.</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/875888</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/875888</guid><dc:creator><![CDATA[FireFlow]]></dc:creator><pubDate>Mon, 19 Sep 2005 15:33:50 GMT</pubDate></item><item><title><![CDATA[Reply to array Frage on Mon, 19 Sep 2005 15:44:47 GMT]]></title><description><![CDATA[<p>Vielen Dank für die schnelle Antwort, hat funktioniert <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/875900</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/875900</guid><dc:creator><![CDATA[Peter567]]></dc:creator><pubDate>Mon, 19 Sep 2005 15:44:47 GMT</pubDate></item></channel></rss>