<?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[abbruch einer schleife über tastatur]]></title><description><![CDATA[<p>HALL0.</p>
<p>ich wollte eine schleife schreiben, die beendet wird, wenn man irgendeine taste auf der tastatur drückt. meine ersten ansätze waren so:</p>
<pre><code class="language-cpp">char EIN;
EIN = '0';
//a.)
while ('0' == EIN)
{
        //...Programmcode...
	cin &gt;&gt; EIN;
}

//b.)
for (NUM=0;;NUM++)
{
        //...Programmcode...
	cin &gt;&gt; EIN;
	if (EIN != '0') break;
}
</code></pre>
<p>erstens funktioniert das nicht und zweitens geht das ja auch nur, wenn keine 0 gedrückt wurde. wie könnte man das verbessern?</p>
<p>DANKE.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/157065/abbruch-einer-schleife-über-tastatur</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 00:50:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/157065.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Aug 2006 03:01:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to abbruch einer schleife über tastatur on Wed, 23 Aug 2006 03:01:42 GMT]]></title><description><![CDATA[<p>HALL0.</p>
<p>ich wollte eine schleife schreiben, die beendet wird, wenn man irgendeine taste auf der tastatur drückt. meine ersten ansätze waren so:</p>
<pre><code class="language-cpp">char EIN;
EIN = '0';
//a.)
while ('0' == EIN)
{
        //...Programmcode...
	cin &gt;&gt; EIN;
}

//b.)
for (NUM=0;;NUM++)
{
        //...Programmcode...
	cin &gt;&gt; EIN;
	if (EIN != '0') break;
}
</code></pre>
<p>erstens funktioniert das nicht und zweitens geht das ja auch nur, wenn keine 0 gedrückt wurde. wie könnte man das verbessern?</p>
<p>DANKE.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1122490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122490</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 23 Aug 2006 03:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to abbruch einer schleife über tastatur on Wed, 23 Aug 2006 05:01:39 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool quit = false;
char eingabe;

while(!quit) {
   eingabe  = getInput (); // getInput ist dann deine Eingabefunktion...
   if (eingabe == 'q' || eingabe == 'Q') {
      quit  = true;
   }
   ...
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1122499</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122499</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Wed, 23 Aug 2006 05:01:39 GMT</pubDate></item><item><title><![CDATA[Reply to abbruch einer schleife über tastatur on Wed, 23 Aug 2006 05:06:58 GMT]]></title><description><![CDATA[<p>DANKE DocJunioR,</p>
<p>ich glaube, du hast mich etwas falsch verstanden. ich will ja gar nichts über die tastatur EINGEBEN, sondern nur überprüfen, ob eine taste gedrückt wurde.</p>
<p>in dem abschnitt &quot;//...Programmcode...&quot; habe ich einen code geschrieben, der permanent bilder aus meiner kamera ausliest und ich will dies abbrechen, sobald irgendeine taste gedrückt wurde. so wie ich das sehe, ist das nicht das gleiche, was du geschrieben hast, bei dir muss ich nach jedem schleifendurchlauf, also in meinem fall nach jedem aufgenommenen bild, eine taste drücke, oder täusche ich mich da?</p>
<p>DANKE.<br />
STICK.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1122500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122500</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 23 Aug 2006 05:06:58 GMT</pubDate></item><item><title><![CDATA[Reply to abbruch einer schleife über tastatur on Wed, 23 Aug 2006 06:05:33 GMT]]></title><description><![CDATA[<p>nicht mehr standard, für linux entsprechendes finden...</p>
<pre><code>#include &lt;conio.h&gt;

while (!(kbhit())){
//do
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1122511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122511</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Wed, 23 Aug 2006 06:05:33 GMT</pubDate></item><item><title><![CDATA[Reply to abbruch einer schleife über tastatur on Wed, 23 Aug 2006 06:17:05 GMT]]></title><description><![CDATA[<p>cin.get() oder cin.peek() könnten vielleicht weiterhelfen..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1122517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122517</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Wed, 23 Aug 2006 06:17:05 GMT</pubDate></item><item><title><![CDATA[Reply to abbruch einer schleife über tastatur on Wed, 23 Aug 2006 06:21:11 GMT]]></title><description><![CDATA[<p>&quot;kbhit()&quot; hat funktioniert.</p>
<p>DANKE!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1122519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1122519</guid><dc:creator><![CDATA[stick_thai]]></dc:creator><pubDate>Wed, 23 Aug 2006 06:21:11 GMT</pubDate></item></channel></rss>