<?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[Datentyp abfragen]]></title><description><![CDATA[<p>Ich möchte meine Eingabe so konfigurieren, das man nur einen integerwert eingeben kann. Gibt man stattdessen einen anderen Typen ein, so bricht das Programmm automatisch ab. Ich möchte stattdessen eine while-schleife machen, die sich solange wiederholt, bis die eingabe vom datentyp integer ist.<br />
Diese Struktur habe ich mir überlegt. Geht aber nicht...</p>
<pre><code class="language-cpp">...
    int wahl;
    cin &gt;&gt; wahl;
    while(wahl==int)
    { cout &lt;&lt; &quot;Nochmal bitte: &quot;; cin &gt;&gt; wahl; }
    cout &lt;&lt; &quot;ok&quot;;

...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/143611/datentyp-abfragen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 06:48:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/143611.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Apr 2006 10:58:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datentyp abfragen on Mon, 10 Apr 2006 10:58:18 GMT]]></title><description><![CDATA[<p>Ich möchte meine Eingabe so konfigurieren, das man nur einen integerwert eingeben kann. Gibt man stattdessen einen anderen Typen ein, so bricht das Programmm automatisch ab. Ich möchte stattdessen eine while-schleife machen, die sich solange wiederholt, bis die eingabe vom datentyp integer ist.<br />
Diese Struktur habe ich mir überlegt. Geht aber nicht...</p>
<pre><code class="language-cpp">...
    int wahl;
    cin &gt;&gt; wahl;
    while(wahl==int)
    { cout &lt;&lt; &quot;Nochmal bitte: &quot;; cin &gt;&gt; wahl; }
    cout &lt;&lt; &quot;ok&quot;;

...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1034371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034371</guid><dc:creator><![CDATA[t1m0n]]></dc:creator><pubDate>Mon, 10 Apr 2006 10:58:18 GMT</pubDate></item><item><title><![CDATA[Reply to Datentyp abfragen on Mon, 10 Apr 2006 11:01:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wird so auch nie funktionieren. Aber du kannst mittels isdigit usw. aus der cstring abfragen, ob das eingegebene char n Buchstabe oder ne Zahl ist. Alternativ frägst du eventuelle Fehler Zustände von cin ab.</p>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034375</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Mon, 10 Apr 2006 11:01:18 GMT</pubDate></item></channel></rss>