<?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[auf int beschränken]]></title><description><![CDATA[<p>hallo</p>
<p>kurze frage:</p>
<p>wie kann ich in c++ sagen:</p>
<p>wenn Variable &quot;a&quot; vom typ int dann mach das ansonsten gib fehlermeldung aus</p>
<p>quasi das man nur ein variable vom typ int un nicht char oder ähnlichem eingeben kann</p>
<p>grtüße manuel</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/164027/auf-int-beschränken</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 14:25:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/164027.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 04 Nov 2006 12:55:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 13:01:07 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>kurze frage:</p>
<p>wie kann ich in c++ sagen:</p>
<p>wenn Variable &quot;a&quot; vom typ int dann mach das ansonsten gib fehlermeldung aus</p>
<p>quasi das man nur ein variable vom typ int un nicht char oder ähnlichem eingeben kann</p>
<p>grtüße manuel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168219</guid><dc:creator><![CDATA[manuel774]]></dc:creator><pubDate>Sat, 04 Nov 2006 13:01:07 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 13:31:52 GMT]]></title><description><![CDATA[<p>Hmm... ich hätte ne idee, bin mir aber sicher, dass man das auch eleganter lösen könnte :</p>
<pre><code class="language-cpp">if (sizeof(a) == sizeof(int))
</code></pre>
<p>Das funktioniert, es gibt aber halt auch typen, die die gleiche größe haben^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168238</guid><dc:creator><![CDATA[Weedjo]]></dc:creator><pubDate>Sat, 04 Nov 2006 13:31:52 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 13:35:18 GMT]]></title><description><![CDATA[<p>Welchen Typ eine Variable hat, legst du doch von vornherein fest. Und indem du deine Funktion als <code>void func(int a)</code> definierst, sorgst du dafür, daß dieser Funktion nur int-Werte übergeben werden können (oder Typen, die nach int konvertiert werden können - aber dann hast du keine Möglichkeit festzustellen, ob da eine Konvertierung dazwischenstand).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168242</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 04 Nov 2006 13:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 13:46:40 GMT]]></title><description><![CDATA[<p>Mich würde mal interessieren,wo man so einen Typvergleich brauch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168253</guid><dc:creator><![CDATA[Tobi3000]]></dc:creator><pubDate>Sat, 04 Nov 2006 13:46:40 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 14:02:50 GMT]]></title><description><![CDATA[<p>man könnte das gebrauchen um eingaben über zb. &lt;&lt; cin zu überprüfen.<br />
ist es kein int dann false.<br />
ich schätze mal das es so gemeint ist.<br />
vielleicht meint er ja<br />
isdigigt()<br />
?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168271</guid><dc:creator><![CDATA[samtauge]]></dc:creator><pubDate>Sat, 04 Nov 2006 14:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 14:14:45 GMT]]></title><description><![CDATA[<p>schön das es direkt mal so viele antworten gab kann nur leider mit den meisten nicht viel anfangen da ich mich noch nicht so weit mit c++ auskenne (machen das seit ca3 monaten in der schule)</p>
<p>ich habe die cpp datei mal unter <a href="http://manuel774.de/schule/ASCII-Programm.cpp" rel="nofollow">http://manuel774.de/schule/ASCII-Programm.cpp</a> bereit gestellt damit jeder reinschauen kann und vielleicht besser versteht was ich meine</p>
<p>das programm um das es sich handelt hat folgende funktionen:<br />
es kann den wert zu einem zeichen ausgeben<br />
es kann das zeichen zu einem wert ausgeben<br />
und<br />
in zwei darstellungsweisen die komplette ASCII-tabelle auszugeben</p>
<p>problem:<br />
startet mal das programm-&gt;geht in die zweite auswahl-&gt;und gebt ein zeichen was keine zahl ist ein....</p>
<p>grüße manuel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168282</guid><dc:creator><![CDATA[manuel774]]></dc:creator><pubDate>Sat, 04 Nov 2006 14:14:45 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 14:19:46 GMT]]></title><description><![CDATA[<p>Achso, das geht eigentlich recht einfach <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="😉"
    /></p>
<p>cin setzt ein Fehlerflag, wenn etwas ungültiges reingekommen ist. Das kannst du auswerten und entsprechend darauf reagieren:</p>
<pre><code class="language-cpp">cin&gt;&gt;eingabewert;
if(!cin)//Fehler aufgetreten
{
  cout&lt;&lt;&quot;Falsche Eingabe!!&quot;&lt;&lt;endl;
  cin.clear(); //Fehlerflags zurücksetzen
  cin.ignore();//Fehleingabe verwerfen
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1168285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168285</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 04 Nov 2006 14:19:46 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 14:22:15 GMT]]></title><description><![CDATA[<p>afaik müsste das der code dafür sein:</p>
<pre><code class="language-cpp">if(typeof(a).name() == typeof(int).name())
{
//a ist vom typ int
}
else
{
//a ist nicht vom typ int
}
</code></pre>
<p>auserdem:<br />
es heist</p>
<pre><code class="language-cpp">int main()
</code></pre>
<p>und <strong>NICHT</strong> void !!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168286</guid><dc:creator><![CDATA[branleb]]></dc:creator><pubDate>Sat, 04 Nov 2006 14:22:15 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 14:34:27 GMT]]></title><description><![CDATA[<p>was brauche ich den für eine header datei für den lösungsvorschlag von shade37337 ??</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168296</guid><dc:creator><![CDATA[manuel774]]></dc:creator><pubDate>Sat, 04 Nov 2006 14:34:27 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 14:37:28 GMT]]></title><description><![CDATA[<p>Gar keinen - aber wenn ich mir deinen Quellcode ansehe, hat der Ansatz auch recht wenig mit deinem Quellcode zu tun. (du hast deine Variable als int deklariert, also WIRD dir auch jeder Versuch sagen, daß das ein int ist - ob du erfolgreich etwas dort einlesen konntest, ist die andere Sache (aber das kann dir cin mitteilen, wenn du danach fragst))</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168299</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Sat, 04 Nov 2006 14:37:28 GMT</pubDate></item><item><title><![CDATA[Reply to auf int beschränken on Sat, 04 Nov 2006 15:00:07 GMT]]></title><description><![CDATA[<p>mit CStolls Lösung klappts</p>
<p>danke dafür</p>
<p>grüße manuel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1168315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1168315</guid><dc:creator><![CDATA[manuel774]]></dc:creator><pubDate>Sat, 04 Nov 2006 15:00:07 GMT</pubDate></item></channel></rss>