<?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[JA oder NEIN Eingabe weiter verwenden]]></title><description><![CDATA[<p>Tag bin beim meinem consolen Programm auf ein problem gestossen (Anfänger) will bei JA oder Nein Frage angekommen und will natürlich die antwort weiter verwenden mit zB einer IF Funktion wer kann mir ein beispiel schicken, wäre sehr dankbar dafür!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/123725/ja-oder-nein-eingabe-weiter-verwenden</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 16:42:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/123725.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Oct 2005 13:22:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 13:22:59 GMT]]></title><description><![CDATA[<p>Tag bin beim meinem consolen Programm auf ein problem gestossen (Anfänger) will bei JA oder Nein Frage angekommen und will natürlich die antwort weiter verwenden mit zB einer IF Funktion wer kann mir ein beispiel schicken, wäre sehr dankbar dafür!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896095</guid><dc:creator><![CDATA[do_this_for_the_school]]></dc:creator><pubDate>Wed, 19 Oct 2005 13:22:59 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 13:25:49 GMT]]></title><description><![CDATA[<p>Ganz kurzes Beispielfragment</p>
<pre><code class="language-cpp">cout&lt;&lt;&quot;Wollen Sie weitermachen (j/n)?\n&quot;;
char ans;cin&gt;&gt;ans;
if(tolower(ans)!='j')
  exit(0);
else
  cout&lt;&lt;OK, dann geht es hier weiter.\n&quot;;
</code></pre>
<p>(PS: if ist keine Funktion, sondern ein Befehl ;))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896099</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896099</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 19 Oct 2005 13:25:49 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 13:50:41 GMT]]></title><description><![CDATA[<p>a statt cout benutze ich printf ist das oK, ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896137</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896137</guid><dc:creator><![CDATA[do_this_for_the_school]]></dc:creator><pubDate>Wed, 19 Oct 2005 13:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 13:52:40 GMT]]></title><description><![CDATA[<p>kannst du machen (und erhältst damit das selbe Ergebnis), aber cin/cout ist typsicherer ;).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896141</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896141</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 19 Oct 2005 13:52:40 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:03:58 GMT]]></title><description><![CDATA[<p>char ans;<br />
printf(&quot;Wollen Sie weitermachen (j/n)?\n&quot;);<br />
scanf(&quot;%c&quot;,ans);<br />
if(tolower(ans)!='j')<br />
exit(0);<br />
else<br />
printf(&quot;OK, dann geht es hier weiter.\n&quot;);<br />
}<br />
getch();</p>
<p>dann kommt eine fehlermeldung!!<br />
kannst du den Fehler erkennen, es steht noch data definition has no type or storage class</p>
<p>was bedeutet &quot;tolower&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896151</guid><dc:creator><![CDATA[do_this_for_the_school]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:03:58 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:05:17 GMT]]></title><description><![CDATA[<p>In welcher Zeile kommt denn der Fehler? Ich würde ja darauf tippen, daß eine wichtige Header-Datei fehlt (leider weiß ich nicht aus dem Kopf, in welcher tolower() untergebracht ist).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896158</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896158</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:05:17 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:08:40 GMT]]></title><description><![CDATA[<p>ich grad gekuckt das die zeile</p>
<p>scanf(&quot;%c&quot;,ans);</p>
<p>den fehler verursacht,</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896166</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896166</guid><dc:creator><![CDATA[do_this_for_the_school]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:08:40 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:10:57 GMT]]></title><description><![CDATA[<p>Und da haben wir schon den Übeltäter - scanf ist ein Relikt aus C-Zeiten und benötigt deshalb keine Referenz, sondern pointer: &quot;scanf(&quot;%c&quot;,**&amp;**ans);&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896174</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:18:38 GMT]]></title><description><![CDATA[<p>jetzt wird das programm geschlossen<br />
ist eine Consolen anwendung</p>
<p>/*<br />
a=Alter<br />
b=Antwort<br />
*/<br />
main() {<br />
int a;<br />
char b;<br />
printf(&quot;Wollen Sie weitermachen (j/n)?\n&quot;);<br />
scanf(&quot;%c&quot;,&amp;b);<br />
sleep(5000); //nach 5 sec wird das Programm geschlossen<br />
printf(&quot;hint&quot;);<br />
if(tolower(b)!='j')<br />
printf(&quot;\nOk oK&quot;);<br />
else<br />
printf(&quot;OK, dann geht es hier weiter.\n&quot;);<br />
}<br />
getch();</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896189</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896189</guid><dc:creator><![CDATA[do_this_for_the_school]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:18:38 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:23:12 GMT]]></title><description><![CDATA[<p>Die Auswertung, was nach der jeweiligen Antwort geschieht, bleibt natürlich dir selber überlassen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> Im einfachsten Fall ist das eine if()-Abfrage (&quot;'j' gedrückt = JA&quot; vs. &quot;andere Taste gedrückt = NEIN&quot;), für komplexere Entscheidungen kannst du auch switch/case verwenden oder längere Antworten mittels std::string (notfalls auch mit char* und strcmp,... - aber wozu haben wir die STL, wenn wir sie nicht nutzen wollen?) auswerten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896200</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:23:12 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:56:10 GMT]]></title><description><![CDATA[<p>do_this_for_the_school schrieb:</p>
<blockquote>
<p>was bedeutet &quot;tolower&quot;</p>
</blockquote>
<p><a href="http://cppreference.com/stdstring/tolower.html" rel="nofollow">tolower()</a> in &lt;cctype&gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896243</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896243</guid><dc:creator><![CDATA[terraner]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:56:10 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 14:59:55 GMT]]></title><description><![CDATA[<p>do_this_for_the_school schrieb:</p>
<blockquote>
<pre><code class="language-cpp">scanf(&quot;%c&quot;,&amp;b);
sleep(5000);   //nach 5 sec wird das Programm geschlossen
</code></pre>
</blockquote>
<p>unnötig, weil scanf blockierend ist - so wie die fast alle stdlib funktionen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896248</guid><dc:creator><![CDATA[terraner]]></dc:creator><pubDate>Wed, 19 Oct 2005 14:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 15:28:33 GMT]]></title><description><![CDATA[<p>terraner schrieb:</p>
<blockquote>
<p>do_this_for_the_school schrieb:</p>
<blockquote>
<pre><code class="language-cpp">scanf(&quot;%c&quot;,&amp;b);
sleep(5000);   //nach 5 sec wird das Programm geschlossen
</code></pre>
</blockquote>
<p>unnötig, weil scanf blockierend ist - so wie die fast alle stdlib funktionen.</p>
</blockquote>
<p>öhm ist scanf nicht aus der stdio -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896275</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896275</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Wed, 19 Oct 2005 15:28:33 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 15:43:36 GMT]]></title><description><![CDATA[<p>Nur so nebenbei: Für tolower braucht ihr nen unsigned char und nicht char.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896292</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896292</guid><dc:creator><![CDATA[undefined behaviour]]></dc:creator><pubDate>Wed, 19 Oct 2005 15:43:36 GMT</pubDate></item><item><title><![CDATA[Reply to JA oder NEIN Eingabe weiter verwenden on Wed, 19 Oct 2005 15:54:07 GMT]]></title><description><![CDATA[<p>shapeless schrieb:</p>
<blockquote>
<p>öhm ist scanf nicht aus der stdio -.-</p>
</blockquote>
<p>stdio.h (GCC 3.4.1) schrieb:</p>
<blockquote>
<p>/* Read formatted input from stdin.</p>
<p>This function is a possible cancellation point and therefore not<br />
marked with __THROW. */<br />
extern int scanf (__const char *__restrict __format, ...);</p>
</blockquote>
<p><a href="http://cppreference.com/stdio/scanf.html" rel="nofollow">hier</a> ist es auch in stdio zu finden.</p>
<p>edit: juhu, 2^9 postings!!1!!11!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/896308</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/896308</guid><dc:creator><![CDATA[terraner]]></dc:creator><pubDate>Wed, 19 Oct 2005 15:54:07 GMT</pubDate></item></channel></rss>