<?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[C++ Strings]]></title><description><![CDATA[<p>Hallo,<br />
ich will mich kurz vostellen, ich bin Christoph und programmiere in C++.<br />
Ich wollte hier fragen, wie ich in C++ Strings programmieren kann, aber so, dass das Programm alle eingegebenen Wörter überprüft.<br />
Danke im Vorraus für die Antworten<br />
Gruß,<br />
Christoph</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/316385/c-strings</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 09:36:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/316385.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 May 2013 05:08:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 05:08:43 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich will mich kurz vostellen, ich bin Christoph und programmiere in C++.<br />
Ich wollte hier fragen, wie ich in C++ Strings programmieren kann, aber so, dass das Programm alle eingegebenen Wörter überprüft.<br />
Danke im Vorraus für die Antworten<br />
Gruß,<br />
Christoph</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320234</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320234</guid><dc:creator><![CDATA[Christoph-C++]]></dc:creator><pubDate>Thu, 02 May 2013 05:08:43 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 06:57:08 GMT]]></title><description><![CDATA[<p>Hallo Christoph,</p>
<p>Willkommen im C++-Forum.</p>
<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>Ich wollte hier fragen, wie ich in C++ Strings programmieren kann, aber so, dass das Programm alle eingegebenen Wörter überprüft.</p>
</blockquote>
<p>es ist ein bisschen unklar, was Du genau damit meinst, bzw. vor hast. Beschreibe einfach, was Dein Programm als Eingabe erwartet und was als Ausgabe erscheinen soll.</p>
<p>Der String-Typ in C++ ist <a href="http://www.cplusplus.com/reference/string/string" rel="nofollow">std::string</a>. Du benötigst dazu ein <code>#include &lt;string&gt;</code> . Kleines Beispiel:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;

int main()
{
    using namespace std;
    cout &lt;&lt; &quot;Bitte einzelne Worte eingeben&quot; &lt;&lt; endl;
    for( string wort; cin &gt;&gt; wort; )
    {
        cout &lt;&lt; &quot;Ihre Eingabe: '&quot; &lt;&lt; wort &lt;&lt; &quot;'&quot; &lt;&lt; endl;
        // mache was mit 'wort'
    }
}
</code></pre>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320244</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 02 May 2013 06:57:08 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:44:03 GMT]]></title><description><![CDATA[<blockquote>
<p>aber so, dass das Programm alle eingegebenen Wörter überprüft.</p>
</blockquote>
<p>Wie du Wörter einliest, hat dir Werner gezeigt - beachte aber: Wenn du einen std::string mit einem istream wie cin so einliest:</p>
<pre><code>cin &gt;&gt; wort;
</code></pre>
<p>Wird nur bis zum ersten Whitespace ( also Leerzeichen, Tabulator, usw. )gelesen. Genau wie du willst - ein Wort nur - merke es dir aber, wenn du eine Zeile einlesen willst, nutze <code>std::getline</code> .</p>
<p>Wenn du einen String nun überprüfen willst, dann gibt es da im Allgemeinen viele Funktionen - bspw. könntest du prüfen, ob an der x-ten Stelle im String ein bestimmtes Zeichen steht:</p>
<pre><code>if( wort.length() &gt; x &amp;&amp; wort[x] == 'a' )
    // ...
</code></pre>
<p>Oder ob im Wort eine Silbe enthalten ist:</p>
<pre><code>if( wort.find( &quot;er&quot; ) != std::string::npos ) // alternativ auch den Rückgabewert speichern. Dann hast du auch die Position.
    // ...
</code></pre>
<p>Oder ob es, alphabetisch sortiert mit einem anderen String, kleiner ist:</p>
<pre><code>std::string base(&quot;Maus&quot;);
if( wort &lt; base ) // true wenn wort alphabetisch sortiert vor &quot;Maus&quot; kommt
    // ....
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2320287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320287</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 02 May 2013 11:44:03 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:33:07 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Oder ob im Wort eine Silbe enthalten ist:</p>
<pre><code>if( wort.find( &quot;er&quot; ) )
    // ...
</code></pre>
</blockquote>
<p>Das geht aber anders, füchte ich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320299</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 02 May 2013 11:33:07 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:35:31 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Oder ob es, alphabetisch sortiert mit einem anderen String, kleiner ist:</p>
<pre><code>std::string base(&quot;Maus&quot;);
if( std::lexigraphical_compare( wort.begin(), wort.end(), base.begin(), base.end() ) ) // true wenn wort alphabetisch sortiert vor base kommt
    // ....
</code></pre>
</blockquote>
<p>In anderen Sprachen klappt sogar</p>
<pre><code>if(wort&lt;base)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2320300</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320300</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 02 May 2013 11:35:31 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:36:06 GMT]]></title><description><![CDATA[<p>Und statt std::lexi<strong>co</strong>graphical_compare wäre operator&lt; etwas einfacher.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320301</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320301</guid><dc:creator><![CDATA[Mixie]]></dc:creator><pubDate>Thu, 02 May 2013 11:36:06 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:43:00 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>Oder ob im Wort eine Silbe enthalten ist:</p>
<pre><code>if( wort.find( &quot;er&quot; ) )
    // ...
</code></pre>
</blockquote>
<p>Das geht aber anders, fürchte ich.</p>
</blockquote>
<p>Was soll das heißen?<br />
Edit: Was denn los heute... tja, halt ungetestet.. :kopf-&gt;tisch:</p>
<p>Mixie schrieb:</p>
<blockquote>
<p>Und statt std::lexi<strong>co</strong>graphical_compare wäre operator&lt; etwas einfacher.</p>
</blockquote>
<p>Ups, war natürlich ungetestet, daher der Rechtschreib(?)fehler.<br />
Natürlich geht auch <code>operator&lt;</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320303</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 02 May 2013 11:43:00 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:45:37 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>volkard schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>Oder ob im Wort eine Silbe enthalten ist:</p>
<pre><code>if( wort.find( &quot;er&quot; ) )
    // ...
</code></pre>
</blockquote>
<p>Das geht aber anders, fürchte ich.</p>
</blockquote>
<p>Was soll das heißen?</p>
</blockquote>
<p>try this:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

int main()
{
    string str = &quot;ganzLangerString&quot;;
    string substr = &quot;ganz&quot;;

    if (str.find(substr))
      cout &lt;&lt; &quot;enthalten&quot; &lt;&lt; endl;
    else
      cout &lt;&lt; &quot;nicht enthalten&quot; &lt;&lt; endl; 

    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2320307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320307</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 02 May 2013 11:45:37 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 11:47:23 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>volkard schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>Oder ob im Wort eine Silbe enthalten ist:</p>
<pre><code>if( wort.find( &quot;er&quot; ) )
    // ...
</code></pre>
</blockquote>
<p>Das geht aber anders, fürchte ich.</p>
</blockquote>
<p>Was soll das heißen?</p>
</blockquote>
<p><code>std::string::npos</code></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320309</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Thu, 02 May 2013 11:47:23 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:17:13 GMT]]></title><description><![CDATA[<p>Hallo,<br />
danke für die Schnellen Antworten.<br />
Ich will das so machen:<br />
eingeben:</p>
<p>Der neue Computer</p>
<p>Das Programm macht daraus dann:<br />
Der<br />
neue<br />
Computer</p>
<p>und verarbeitet das dann.</p>
<p>Gruß,<br />
Christoph</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320338</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320338</guid><dc:creator><![CDATA[Christoph-C++]]></dc:creator><pubDate>Thu, 02 May 2013 13:17:13 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:19:00 GMT]]></title><description><![CDATA[<p>Also du willst einen std::string auftrennen und Leerzeichen als Separator verwenden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320342</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Thu, 02 May 2013 13:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:19:00 GMT]]></title><description><![CDATA[<pre><code>std::string a, b, c;
std::cin &gt;&gt; a &gt;&gt; b &gt;&gt; c;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2320341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320341</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Thu, 02 May 2013 13:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:26:49 GMT]]></title><description><![CDATA[<p>Genau<br />
wie mach ich das, dass man nur eine Zeile eingeben muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320344</guid><dc:creator><![CDATA[Christoph-C++]]></dc:creator><pubDate>Thu, 02 May 2013 13:26:49 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:29:39 GMT]]></title><description><![CDATA[<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>Genau<br />
wie mach ich das, dass man nur eine Zeile eingeben muss.</p>
</blockquote>
<p>So wie in den Antworten von Werner Salomon, Sone und Nathan bereits 3x gezeigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320347</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 02 May 2013 13:29:39 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:29:56 GMT]]></title><description><![CDATA[<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>Genau<br />
wie mach ich das, dass man nur eine Zeile eingeben muss.</p>
</blockquote>
<p>Du musst gar nichts machen. Verwende den Vorschlag von Nathan, oder den von mir. Die Programme machen genau das. Du musst lediglich die Ausgabe etwas anpassen.</p>
<pre><code>cout &lt;&lt; wort &lt;&lt; endl;
</code></pre>
<p>.. und falls Dir einer was mit getline vorschlägt - vergiss es!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320348</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 02 May 2013 13:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:34:32 GMT]]></title><description><![CDATA[<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>... und verarbeitet das dann.</p>
</blockquote>
<p>was bedeutet das? was soll Dein Programm ausgeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320349</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 02 May 2013 13:34:32 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:37:49 GMT]]></title><description><![CDATA[<p>Werner Salomon schrieb:</p>
<blockquote>
<p>.. und falls Dir einer was mit getline vorschlägt - vergiss es!</p>
</blockquote>
<p>wieso, ist getleine böse?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320351</guid><dc:creator><![CDATA[c++ n00b]]></dc:creator><pubDate>Thu, 02 May 2013 13:37:49 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 13:38:49 GMT]]></title><description><![CDATA[<p>c++ n00b schrieb:</p>
<blockquote>
<p>Werner Salomon schrieb:</p>
<blockquote>
<p>.. und falls Dir einer was mit getline vorschlägt - vergiss es!</p>
</blockquote>
<p>wieso, ist getleine böse?</p>
</blockquote>
<p>Nein, aber es ist hier nicht die richtige Antwort.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320352</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 02 May 2013 13:38:49 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:13:24 GMT]]></title><description><![CDATA[<p>Ich wollte ein Programm schreiben, welches MicroForth heißt.<br />
Das will ich nach dem Prinzip von einem in BASIC geschriebenen Programm anschließen, das verarbeitet nämlich die Eingabe nach den Strings.<br />
Das will ich auch machen. Vorteile wären bei C++, dass man das Programm leichter strukturieren kann. In BASIC hat man die Zahlen davor.<br />
Das Programm verarbeitet die Eingaben und speichert sie.<br />
Wenn ich eingebe<br />
: Test 100 1 do i . loop<br />
Dann Test eingeben:<br />
1,2,3,4,5,6,7,8,9,10...100<br />
So soll das Programm die Strings in einen Teilstring einspeichern und dann verarbeiten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320385</guid><dc:creator><![CDATA[Christoph-C++]]></dc:creator><pubDate>Thu, 02 May 2013 15:13:24 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:19:17 GMT]]></title><description><![CDATA[<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>So soll das Programm die Strings in einen Teilstring einspeichern und dann verarbeiten.</p>
</blockquote>
<p>Das ist das Problem. Das alte EVA-Prinzip.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320386</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320386</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 02 May 2013 15:19:17 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:21:42 GMT]]></title><description><![CDATA[<p>Wie kann ich sowas machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320387</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320387</guid><dc:creator><![CDATA[Christoph-C++]]></dc:creator><pubDate>Thu, 02 May 2013 15:21:42 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:28:05 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>So soll das Programm die Strings in einen Teilstring einspeichern und dann verarbeiten.</p>
</blockquote>
<p>Das ist das Problem. Das alte EVA-Prinzip.</p>
</blockquote>
<p>Oder REPL ...</p>
<blockquote>
<p>Wie kann ich sowas machen?</p>
</blockquote>
<p>1.) Read: Einlesen des gesamten Strings.<br />
2.) Eval: String zerlegen und interpretieren<br />
3.) Print: Ergebnis anzeigen<br />
4.) Loop: Gehe zu Schritt 1.)</p>
<blockquote>
<p>MicroForth</p>
</blockquote>
<p>Es gibt soooviel Tutorials, wie Forth zu implementieren ist, google ist dein Freund.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320388</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320388</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Thu, 02 May 2013 15:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:38:23 GMT]]></title><description><![CDATA[<p>knivil schrieb:</p>
<blockquote>
<p>volkard schrieb:</p>
<blockquote>
<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>So soll das Programm die Strings in einen Teilstring einspeichern und dann verarbeiten.</p>
</blockquote>
<p>Das ist das Problem. Das alte EVA-Prinzip.</p>
</blockquote>
<p>Oder REPL ...</p>
<blockquote>
<p>Wie kann ich sowas machen?</p>
</blockquote>
<p>1.) Read: Einlesen des gesamten Strings.<br />
2.) Eval: String zerlegen und interpretieren<br />
3.) Print: Ergebnis anzeigen<br />
4.) Loop: Gehe zu Schritt 1.)</p>
</blockquote>
<p>Mit EVA meinte ich<br />
1.) Eingabe<br />
2.) Verarbeitung erst, wenn Eingabe abgeschlossen.<br />
3.) Ausgabe erst, wenn Verarbeitung abgeschlossen.</p>
<p>Und so kommts,</p>
<ol>
<li>aus einem istream die eingabe lesen und in einen string stecken.</li>
<li>den in einen istringstream stecken und als istream behandeln, um ihn zu interpretieren. Und davon wird Werner immer so traurig.</li>
</ol>
]]></description><link>https://www.c-plusplus.net/forum/post/2320394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320394</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Thu, 02 May 2013 15:38:23 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:50:37 GMT]]></title><description><![CDATA[<blockquote>
<p>den in einen istringstream stecken und als istream behandeln, um ihn zu interpretieren. Und davon wird Werner immer so traurig.</p>
</blockquote>
<p>Ja, denn es gibt keinen Grund das zu machen. Welcher Vorteil ist dabei?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320395</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Thu, 02 May 2013 15:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 15:58:14 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Mit EVA meinte ich</p>
</blockquote>
<p>Ich weiss, nur dachte ich, dass EVA ein schlechter Suchbegriff ist. Aber ich bin von google positiv ueberrascht. Der zweite Treffer gleich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320400</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Thu, 02 May 2013 15:58:14 GMT</pubDate></item><item><title><![CDATA[Reply to C++ Strings on Thu, 02 May 2013 16:16:57 GMT]]></title><description><![CDATA[<p>Christoph-C++ schrieb:</p>
<blockquote>
<p>Genau<br />
wie mach ich das, dass man nur eine Zeile eingeben muss.</p>
</blockquote>
<p>Nur eine Zeile eingeben:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;sstream&gt;
#include &lt;iterator&gt;
using namespace std;

int main()
{
	cout &lt;&lt; &quot;eine Zeile eingeben:\n&quot;;
	string zeile;
	getline(cin,zeile);

	istringstream iss(zeile);
	vector&lt;string&gt; worte( (istream_iterator&lt;string&gt;(iss)), (istream_iterator&lt;string&gt;()) );

	// Ab hier hast du nun alle Wörter in einem Array...
}
</code></pre>
<p>Ich würde es aber nicht so machen. Finde Werners Vorschlag besser.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2320406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2320406</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Thu, 02 May 2013 16:16:57 GMT</pubDate></item></channel></rss>