<?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[Hilfe!!!!!!!!!!!!]]></title><description><![CDATA[<p>Hallo<br />
Ich wollte vor einiger zeit ein programm schreiben mit dem man reden kann.<br />
Allerdings sollten es keine festen befehle sein, auf die das programm dann antwortet, mann müsste also aus einem eingegebenem satz bestimmte bekannte wörter herrausfiltern Z.B. eingabe: hallo ;antwort: Hi<br />
oder<br />
eingabe: hallo blablabla ;antwort trotzdem: Hi</p>
<p>Das habe ich mit so gemacht:</p>
<pre><code class="language-cpp">char eingabe[1400];
gets (eingabe);
if (strstr(eingabe, &quot;hallo&quot; ) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
</code></pre>
<p>(diesen code zum herrausfiltern habe ich in irgendeinem forum gefunden)</p>
<p>So weit bin ich bis jezt mit dem ganzen programm:</p>
<pre><code class="language-cpp">#include &lt;cstdio&gt;
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;windows.h&gt; 
#include &lt;shellapi.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#pragma once
#include &lt;mmsystem.h&gt;
#include &lt;winuser.h&gt; 
#include &lt;tlhelp32.h&gt;
#pragma comment(lib,&quot;winmm.lib&quot;)
#include &lt;process.h&gt;
using namespace std;

int main(){

start:
char eingabe[1400];
gets (eingabe);

//Begrüssungen

if (strstr(eingabe, &quot;Hi&quot; ) !=0)
cout &lt;&lt; &quot;&gt;hallo&quot; &lt;&lt;endl;
if (strstr(eingabe, &quot;sers&quot; ) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;wie gehts&quot;) !=0)
cout &lt;&lt; &quot;&gt;Gut&quot; &lt;&lt;endl;	
else
if (strstr(eingabe, &quot;hallo&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;servus&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hallo&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;off&quot;) !=0) 
exit(1); 
else 
// musik
if (strstr(eingabe, &quot;spiel have a nice day&quot;) !=0) 
PlaySound (TEXT (&quot;2.wav&quot;), NULL, SND_FILENAME | SND_ASYNC) ;
else 
if (strstr(eingabe, &quot;stop&quot;) !=0)
PlaySound(0,0,0); 
else
//special
if (strstr(eingabe, &quot;//show code&quot;) !=0)
system(&quot;main.cpp&quot;);
else
//websites
if (strstr(eingabe, &quot;tintenherr.de&quot;) !=0)
system(&quot;start http://tintenherr.de/&quot;);
else
//anderes
if (strstr(eingabe, &quot;herunterfahren&quot;) !=0)
system(&quot;C:\\WINDOWS\\System32\\shutdown.exe -s -f -t 0 &quot;);      

goto start;
return 0;

}
</code></pre>
<p>jezt wollte ich , dass wenn man z.b. &quot;wie gehts eintippt&quot;, dass das programm dann erst &quot;gut&quot; antwortet, dann 2 sec wartet und dann fragt &quot;und dir?&quot; , worauf man dann entweder gut oder schlecht antworten kann.</p>
<p>allerdings funzt es so wie ich es gemacht hab nicht:</p>
<pre><code class="language-cpp">#include &lt;cstdio&gt;
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;windows.h&gt; 
#include &lt;shellapi.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#pragma once
#include &lt;mmsystem.h&gt;
#include &lt;winuser.h&gt; 
#include &lt;tlhelp32.h&gt;
#pragma comment(lib,&quot;winmm.lib&quot;)
#include &lt;process.h&gt;
using namespace std;

int main(){

start:
char eingabe[1400];
gets (eingabe);

//Begrüssungen

if (strstr(eingabe, &quot;Hi&quot; ) !=0)
cout &lt;&lt; &quot;&gt;hallo&quot; &lt;&lt;endl;
if (strstr(eingabe, &quot;sers&quot; ) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;wie gehts&quot;) !=0)
cout &lt;&lt; &quot;&gt;Gut&quot; &lt;&lt;endl;	
	Sleep(2000);
	cout&lt;&lt;&quot;und dir?&quot;&lt;&lt;endl;
	char eingabe2[555555];
	gets(eingabe2);
	if (strstr(eingabe, &quot;gut&quot;) !=0) 
		cout&lt;&lt;&quot;schön&quot;&lt;&lt;endl;
		goto start;
	else
	if (strstr(eingabe, &quot;schlecht&quot;) !=0) 
		cout&lt;&lt;&quot;schade&quot;&lt;&lt;endl;
		goto start;
else
if (strstr(eingabe, &quot;hallo&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;servus&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hallo&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;off&quot;) !=0) 
exit(1); 
else 
// musik
if (strstr(eingabe, &quot;spiel have a nice day&quot;) !=0) 
PlaySound (TEXT (&quot;2.wav&quot;), NULL, SND_FILENAME | SND_ASYNC) ;
else 
if (strstr(eingabe, &quot;stop&quot;) !=0)
PlaySound(0,0,0); 
else
//special
if (strstr(eingabe, &quot;//show code&quot;) !=0)
system(&quot;main.cpp&quot;);
else
//websites
if (strstr(eingabe, &quot;tintenherr.de&quot;) !=0)
system(&quot;start http://tintenherr.de/&quot;);
else
//anderes
if (strstr(eingabe, &quot;herunterfahren&quot;) !=0)
system(&quot;C:\\WINDOWS\\System32\\shutdown.exe -s -f -t 0 &quot;);      

goto start;
return 0;

}
</code></pre>
<p>was habe ich falsch gemacht????</p>
<p>PS:Ich benutze Microsoft Visual C++ express 2010<br />
PS:Ich kenne mich mit C++ noch nicht so gut aus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/293330/hilfe</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 10:44:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/293330.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Sep 2011 15:23:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hilfe!!!!!!!!!!!! on Fri, 30 Sep 2011 15:23:12 GMT]]></title><description><![CDATA[<p>Hallo<br />
Ich wollte vor einiger zeit ein programm schreiben mit dem man reden kann.<br />
Allerdings sollten es keine festen befehle sein, auf die das programm dann antwortet, mann müsste also aus einem eingegebenem satz bestimmte bekannte wörter herrausfiltern Z.B. eingabe: hallo ;antwort: Hi<br />
oder<br />
eingabe: hallo blablabla ;antwort trotzdem: Hi</p>
<p>Das habe ich mit so gemacht:</p>
<pre><code class="language-cpp">char eingabe[1400];
gets (eingabe);
if (strstr(eingabe, &quot;hallo&quot; ) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
</code></pre>
<p>(diesen code zum herrausfiltern habe ich in irgendeinem forum gefunden)</p>
<p>So weit bin ich bis jezt mit dem ganzen programm:</p>
<pre><code class="language-cpp">#include &lt;cstdio&gt;
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;windows.h&gt; 
#include &lt;shellapi.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#pragma once
#include &lt;mmsystem.h&gt;
#include &lt;winuser.h&gt; 
#include &lt;tlhelp32.h&gt;
#pragma comment(lib,&quot;winmm.lib&quot;)
#include &lt;process.h&gt;
using namespace std;

int main(){

start:
char eingabe[1400];
gets (eingabe);

//Begrüssungen

if (strstr(eingabe, &quot;Hi&quot; ) !=0)
cout &lt;&lt; &quot;&gt;hallo&quot; &lt;&lt;endl;
if (strstr(eingabe, &quot;sers&quot; ) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;wie gehts&quot;) !=0)
cout &lt;&lt; &quot;&gt;Gut&quot; &lt;&lt;endl;	
else
if (strstr(eingabe, &quot;hallo&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;servus&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hallo&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;off&quot;) !=0) 
exit(1); 
else 
// musik
if (strstr(eingabe, &quot;spiel have a nice day&quot;) !=0) 
PlaySound (TEXT (&quot;2.wav&quot;), NULL, SND_FILENAME | SND_ASYNC) ;
else 
if (strstr(eingabe, &quot;stop&quot;) !=0)
PlaySound(0,0,0); 
else
//special
if (strstr(eingabe, &quot;//show code&quot;) !=0)
system(&quot;main.cpp&quot;);
else
//websites
if (strstr(eingabe, &quot;tintenherr.de&quot;) !=0)
system(&quot;start http://tintenherr.de/&quot;);
else
//anderes
if (strstr(eingabe, &quot;herunterfahren&quot;) !=0)
system(&quot;C:\\WINDOWS\\System32\\shutdown.exe -s -f -t 0 &quot;);      

goto start;
return 0;

}
</code></pre>
<p>jezt wollte ich , dass wenn man z.b. &quot;wie gehts eintippt&quot;, dass das programm dann erst &quot;gut&quot; antwortet, dann 2 sec wartet und dann fragt &quot;und dir?&quot; , worauf man dann entweder gut oder schlecht antworten kann.</p>
<p>allerdings funzt es so wie ich es gemacht hab nicht:</p>
<pre><code class="language-cpp">#include &lt;cstdio&gt;
#include &lt;stdio.h&gt;
#include &lt;conio.h&gt;
#include &lt;string.h&gt;
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;windows.h&gt; 
#include &lt;shellapi.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#pragma once
#include &lt;mmsystem.h&gt;
#include &lt;winuser.h&gt; 
#include &lt;tlhelp32.h&gt;
#pragma comment(lib,&quot;winmm.lib&quot;)
#include &lt;process.h&gt;
using namespace std;

int main(){

start:
char eingabe[1400];
gets (eingabe);

//Begrüssungen

if (strstr(eingabe, &quot;Hi&quot; ) !=0)
cout &lt;&lt; &quot;&gt;hallo&quot; &lt;&lt;endl;
if (strstr(eingabe, &quot;sers&quot; ) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;wie gehts&quot;) !=0)
cout &lt;&lt; &quot;&gt;Gut&quot; &lt;&lt;endl;	
	Sleep(2000);
	cout&lt;&lt;&quot;und dir?&quot;&lt;&lt;endl;
	char eingabe2[555555];
	gets(eingabe2);
	if (strstr(eingabe, &quot;gut&quot;) !=0) 
		cout&lt;&lt;&quot;schön&quot;&lt;&lt;endl;
		goto start;
	else
	if (strstr(eingabe, &quot;schlecht&quot;) !=0) 
		cout&lt;&lt;&quot;schade&quot;&lt;&lt;endl;
		goto start;
else
if (strstr(eingabe, &quot;hallo&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hi&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;servus&quot;) !=0)
cout &lt;&lt; &quot;&gt;Hallo&quot; &lt;&lt;endl;
else 
if (strstr(eingabe, &quot;off&quot;) !=0) 
exit(1); 
else 
// musik
if (strstr(eingabe, &quot;spiel have a nice day&quot;) !=0) 
PlaySound (TEXT (&quot;2.wav&quot;), NULL, SND_FILENAME | SND_ASYNC) ;
else 
if (strstr(eingabe, &quot;stop&quot;) !=0)
PlaySound(0,0,0); 
else
//special
if (strstr(eingabe, &quot;//show code&quot;) !=0)
system(&quot;main.cpp&quot;);
else
//websites
if (strstr(eingabe, &quot;tintenherr.de&quot;) !=0)
system(&quot;start http://tintenherr.de/&quot;);
else
//anderes
if (strstr(eingabe, &quot;herunterfahren&quot;) !=0)
system(&quot;C:\\WINDOWS\\System32\\shutdown.exe -s -f -t 0 &quot;);      

goto start;
return 0;

}
</code></pre>
<p>was habe ich falsch gemacht????</p>
<p>PS:Ich benutze Microsoft Visual C++ express 2010<br />
PS:Ich kenne mich mit C++ noch nicht so gut aus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2125573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2125573</guid><dc:creator><![CDATA[The000jt]]></dc:creator><pubDate>Fri, 30 Sep 2011 15:23:12 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe!!!!!!!!!!!! on Fri, 30 Sep 2011 15:32:01 GMT]]></title><description><![CDATA[<p>Antwort auf deine Frage: so ziemlich alles</p>
<p>Da wäre:<br />
- sinnfreier Titel<br />
- kein Minimalbeispiel<br />
- grauenhafter Code<br />
- keine Fehlerbeschreibung<br />
- keine konkrete Frage (außer &quot;was habe ich falscht gemacht?&quot; - darauf antworte ich dir gerade)</p>
<p>Behebe die aufgezählten Punkte, dann kannst du evtl. eine sinnvolle Antwort erwarten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2125574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2125574</guid><dc:creator><![CDATA[42 is the answer]]></dc:creator><pubDate>Fri, 30 Sep 2011 15:32:01 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe!!!!!!!!!!!! on Fri, 30 Sep 2011 15:35:26 GMT]]></title><description><![CDATA[<p>das is ja doof !!!!!!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2125576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2125576</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Fri, 30 Sep 2011 15:35:26 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe!!!!!!!!!!!! on Fri, 30 Sep 2011 15:36:37 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/200753" rel="nofollow">Du brauchst Hilfe?</a></p>
<p>Kritikpunkte beheben, dann nochmal neu versuchen. Mit so einem Thread wie diesem bekommst du keine brauchbare Antwort, daher mach ich hier mal zu.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2125578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2125578</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 30 Sep 2011 15:36:37 GMT</pubDate></item></channel></rss>