<?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[Vergleich von strings, problem]]></title><description><![CDATA[<p>Hallo!<br />
Ich hab folgendes Programm geschrieben, um eine Funktion zu testen, wie ich gleiche strings herausfinden kann, um bestimmte strings zu suchen.</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
     int i;
     string wort[5], wort6;
     cout &lt;&lt; &quot;Geben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[0];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[1];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[2];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[3];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[4];
     cout &lt;&lt; &quot;\n Geben sie ein Wort ein, nachdem gesucht werden soll: &quot;;
     cin &gt;&gt; wort[5];
     for (i=0;i&lt;5;i++)
     {
         if (wort[5] == wort[i])
         {
                   cout &lt;&lt; &quot;\nDas gleiche Wort wurde gefunden!!!!&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Es ist das &quot; &lt;&lt; i+1 &lt;&lt; &quot; Wort!&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Es lautet &quot; &lt;&lt; wort[i];
         }
         else
         cout &lt;&lt; &quot;\nKeine Uebereinstimmung gefunden...&quot;;
     }
     system(&quot;pause&quot;);
     }
</code></pre>
<p>Vielleicht gibt es auch einen besseren Befehl? Allerdings darf ich noch keine Referenzen, Zeiger, Funktionen und ähnliches benutzen! Auf jeden Fall kommt nach dem ausführen mit C++ BuilderX, nachdem alles funktioniert (Bei dev c++ kommt diese nachricht sofort nach der Eingabe der fünf Worte), Programm hat ein Problem festgestellt und muss beendet werden...<br />
Vielen dank für die Hilfe...<br />
MfG<br />
Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137028/vergleich-von-strings-problem</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 16:38:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137028.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 14 Feb 2006 21:12:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Vergleich von strings, problem on Tue, 14 Feb 2006 21:12:15 GMT]]></title><description><![CDATA[<p>Hallo!<br />
Ich hab folgendes Programm geschrieben, um eine Funktion zu testen, wie ich gleiche strings herausfinden kann, um bestimmte strings zu suchen.</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int main()
{
     int i;
     string wort[5], wort6;
     cout &lt;&lt; &quot;Geben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[0];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[1];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[2];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[3];
     cout &lt;&lt; &quot;\nGeben sie ein Wort ein: &quot;;
     cin &gt;&gt; wort[4];
     cout &lt;&lt; &quot;\n Geben sie ein Wort ein, nachdem gesucht werden soll: &quot;;
     cin &gt;&gt; wort[5];
     for (i=0;i&lt;5;i++)
     {
         if (wort[5] == wort[i])
         {
                   cout &lt;&lt; &quot;\nDas gleiche Wort wurde gefunden!!!!&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Es ist das &quot; &lt;&lt; i+1 &lt;&lt; &quot; Wort!&quot; &lt;&lt; endl;
                   cout &lt;&lt; &quot;Es lautet &quot; &lt;&lt; wort[i];
         }
         else
         cout &lt;&lt; &quot;\nKeine Uebereinstimmung gefunden...&quot;;
     }
     system(&quot;pause&quot;);
     }
</code></pre>
<p>Vielleicht gibt es auch einen besseren Befehl? Allerdings darf ich noch keine Referenzen, Zeiger, Funktionen und ähnliches benutzen! Auf jeden Fall kommt nach dem ausführen mit C++ BuilderX, nachdem alles funktioniert (Bei dev c++ kommt diese nachricht sofort nach der Eingabe der fünf Worte), Programm hat ein Problem festgestellt und muss beendet werden...<br />
Vielen dank für die Hilfe...<br />
MfG<br />
Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/post/994366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/994366</guid><dc:creator><![CDATA[pat112]]></dc:creator><pubDate>Tue, 14 Feb 2006 21:12:15 GMT</pubDate></item><item><title><![CDATA[Reply to Vergleich von strings, problem on Tue, 14 Feb 2006 21:30:15 GMT]]></title><description><![CDATA[<p>string wort[5] hat 5 elemente...</p>
<p>0, 1, 2, 3, 4, 5, hups, das sind ja 6...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/994384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/994384</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Tue, 14 Feb 2006 21:30:15 GMT</pubDate></item></channel></rss>