<?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[String array zurückgeben]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe eine Funktion geschrieben, die einen String auseinanderparst.</p>
<pre><code>CString *parser(char *str)
{
...
    CString *strSearchWords[4];
...
    return strSearchWords[4];
}
</code></pre>
<p>ich will nun nachdem diese funktion aufgerufen wird einen String-Array zurück geben. Nur schaffe ich das irgendwie nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Was gibt es sonst noch für Möglichkeiten einen String-Array zurückzugeben?</p>
<p>Thx schonmal im voraus!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174384/string-array-zurückgeben</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 16:27:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174384.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Feb 2007 10:07:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to String array zurückgeben on Mon, 26 Feb 2007 10:07:58 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe eine Funktion geschrieben, die einen String auseinanderparst.</p>
<pre><code>CString *parser(char *str)
{
...
    CString *strSearchWords[4];
...
    return strSearchWords[4];
}
</code></pre>
<p>ich will nun nachdem diese funktion aufgerufen wird einen String-Array zurück geben. Nur schaffe ich das irgendwie nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Was gibt es sonst noch für Möglichkeiten einen String-Array zurückzugeben?</p>
<p>Thx schonmal im voraus!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1235644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1235644</guid><dc:creator><![CDATA[Rainer Zufall]]></dc:creator><pubDate>Mon, 26 Feb 2007 10:07:58 GMT</pubDate></item><item><title><![CDATA[Reply to String array zurückgeben on Mon, 26 Feb 2007 10:36:17 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Benutzt doch einfach die Klasse CStringArray.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1235663</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1235663</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Feb 2007 10:36:17 GMT</pubDate></item><item><title><![CDATA[Reply to String array zurückgeben on Mon, 26 Feb 2007 10:38:09 GMT]]></title><description><![CDATA[<p>Du hast dort ein Array mit 4 CString-Pointern angelegt - die haben die Indizes 0 bis 3. strSearchWords[4] gehört nicht mehr zu deinem Array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1235665</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1235665</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 26 Feb 2007 10:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to String array zurückgeben on Mon, 26 Feb 2007 11:53:25 GMT]]></title><description><![CDATA[<p>Also ich hab das jetzt so gemacht:</p>
<pre><code>CStringArray parser(char *str)
{
    CStringArray strSearchWords;
    strSearchWords.SetSize(4);

    ...
    // füllen
    strSearchWords.SetAt(0, buf2);
    ...

    return strSearchWords;
}

int main()
{
    CStringArray array;
    array.SetSize(4);
    array = parser(buffer);

    return 0;
}
</code></pre>
<p>Also irgendwas mach ich noch falsch? Ich komm einfach nicht drauf. Hier sind die Compilerfehler:</p>
<pre><code>test.cpp
 WINVER not defined. Defaulting to 0x0501 (Windows XP and Windows .NET Server)
test.cpp(64) : error C2558: class 'CStringArray' : no copy constructor available or copy constructor is declared 'explicit'
test.cpp(79) : error C2582: 'operator =' function is unavailable in 'CStringArray'
</code></pre>
<p>danke für die antworten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1235677</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1235677</guid><dc:creator><![CDATA[Rainer Zufall]]></dc:creator><pubDate>Mon, 26 Feb 2007 11:53:25 GMT</pubDate></item><item><title><![CDATA[Reply to String array zurückgeben on Mon, 26 Feb 2007 12:24:43 GMT]]></title><description><![CDATA[<p>CStringArray ist afaik nicht kopierbar, also kannst du es höchstens per Referenz herumreichen:</p>
<pre><code class="language-cpp">void parser(const char* text,CStringArray&amp; result)
{
  result.SetSize(4);
  ...
}

CStringArray array;
parser(buffer,array);
</code></pre>
<p>(oder noch besser, du nutzt Standard-Mittel: <code>std::vector&lt;std::string&gt;</code> )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1235682</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1235682</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 26 Feb 2007 12:24:43 GMT</pubDate></item><item><title><![CDATA[Reply to String array zurückgeben on Mon, 26 Feb 2007 13:46:29 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>CStoll schrieb:</p>
<blockquote>
<p>[/cpp](oder noch besser, du nutzt Standard-Mittel: <code>std::vector&lt;std::string&gt;</code> )</p>
</blockquote>
<p>Wenn man mit den MFC arbeitet ist das imho nicht immer besser, weil es dann schon Sinn macht, auch mit den angebotenen Klassne zu arbeiten.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1235749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1235749</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Feb 2007 13:46:29 GMT</pubDate></item></channel></rss>