<?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[überprüfen ob string = ganzzahl]]></title><description><![CDATA[<p>Wie kann Ich in c++ überprüfen ob eer nur ganze zahlen enthält ? Ob der String ungleich 5 ist ist ja klar !=5 ... aber wie überprüfen Ich das er nur zahlen erhält ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/308444/überprüfen-ob-string-ganzzahl</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 18:05:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/308444.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Sep 2012 10:11:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 10:11:26 GMT]]></title><description><![CDATA[<p>Wie kann Ich in c++ überprüfen ob eer nur ganze zahlen enthält ? Ob der String ungleich 5 ist ist ja klar !=5 ... aber wie überprüfen Ich das er nur zahlen erhält ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254216</guid><dc:creator><![CDATA[tabtaste]]></dc:creator><pubDate>Tue, 25 Sep 2012 10:11:26 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 11:43:12 GMT]]></title><description><![CDATA[<p>Irgendwie sowas?</p>
<pre><code class="language-cpp">#include &lt;string&gt;
#include &lt;algortihm&gt;
#include &lt;clocale&gt;

bool is_integer(std::string const &amp; str)
{
    return std::count_if(str.begin(), str.end(), &amp;isdigit) == str.size();
}
</code></pre>
<p>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254222</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254222</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Tue, 25 Sep 2012 11:43:12 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 10:37:47 GMT]]></title><description><![CDATA[<p>Du guckst dir alle Zeichen an und prüfst, ob sie Ziffern sind. Vielleicht hilft<br />
<a href="http://www.cplusplus.com/reference/std/locale/isdigit/" rel="nofollow">http://www.cplusplus.com/reference/std/locale/isdigit/</a><br />
oder<br />
<a href="http://www.cplusplus.com/reference/clibrary/cctype/isdigit/" rel="nofollow">http://www.cplusplus.com/reference/clibrary/cctype/isdigit/</a></p>
<p>Erfahrungsgemäß muss ich aber noch anmerken, dass dies so klingt, als wolltest du etwas ganz einfaches auf umständliche Weise erreichen. Nutzereingaben prüfen geht auch direkter. Also: Was willst du überhaupt erreichen? Beschreib das Ziel, nicht nur wie du dir die Umsetzung vorstellst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254223</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 25 Sep 2012 10:37:47 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 11:03:24 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool is_integer(std::string const &amp; str)
{
    return std::count_if(str.begin(), str.end(), &amp;isdigit) == str.size();
}
</code></pre>
<p>Wieso muss das nicht <code>std::isdigit</code> heißen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254233</guid><dc:creator><![CDATA[out]]></dc:creator><pubDate>Tue, 25 Sep 2012 11:03:24 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 11:42:51 GMT]]></title><description><![CDATA[<p>out schrieb:</p>
<blockquote>
<pre><code class="language-cpp">bool is_integer(std::string const &amp; str)
{
    return std::count_if(str.begin(), str.end(), &amp;isdigit) == str.size();
}
</code></pre>
<p>Wieso muss das nicht <code>std::isdigit</code> heißen?</p>
</blockquote>
<p>Naja, eigentlich wäre das besser. Da brauchst Du dann aber noch ein std::locale-Objekt, und das bekommt man dann nicht mehr so schön mit einem Einzeiler hin. So ist es die C-Version von isdigit im globalen Namensraum.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254251</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Tue, 25 Sep 2012 11:42:51 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 12:17:31 GMT]]></title><description><![CDATA[<p>Tachyon schrieb:</p>
<blockquote>
<p>out schrieb:</p>
<blockquote>
<p>Wieso muss das nicht <code>std::isdigit</code> heißen?</p>
</blockquote>
<p>Naja, eigentlich wäre das besser. Da brauchst Du dann aber noch ein std::locale-Objekt, und das bekommt man dann nicht mehr so schön mit einem Einzeiler hin.</p>
</blockquote>
<p>aber sicher doch:</p>
<pre><code class="language-cpp">std::string wort=&quot;12345&quot;;
    if( std::all_of( begin(wort), end(wort), []( char c ) { return std::isdigit( c, std::locale(&quot;&quot;) ); } ))
        std::cout &lt;&lt; &quot;sind alles Ziffern&quot; &lt;&lt; std::endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2254263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254263</guid><dc:creator><![CDATA[Besserwessi]]></dc:creator><pubDate>Tue, 25 Sep 2012 12:17:31 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 12:24:28 GMT]]></title><description><![CDATA[<p>Besserwessi schrieb:</p>
<blockquote>
<p>Tachyon schrieb:</p>
<blockquote>
<p>out schrieb:</p>
<blockquote>
<p>Wieso muss das nicht <code>std::isdigit</code> heißen?</p>
</blockquote>
<p>Naja, eigentlich wäre das besser. Da brauchst Du dann aber noch ein std::locale-Objekt, und das bekommt man dann nicht mehr so schön mit einem Einzeiler hin.</p>
</blockquote>
<p>aber sicher doch:</p>
<pre><code class="language-cpp">std::string wort=&quot;12345&quot;;
    if( std::all_of( begin(wort), end(wort), []( char c ) { return std::isdigit( c, std::locale(&quot;&quot;) ); } ))
        std::cout &lt;&lt; &quot;sind alles Ziffern&quot; &lt;&lt; std::endl;
</code></pre>
</blockquote>
<p>Geht bei mir nicht. Ich hab' kein C++11.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254267</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Tue, 25 Sep 2012 12:24:28 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 12:34:17 GMT]]></title><description><![CDATA[<p>Besserwessi schrieb:</p>
<blockquote>
<pre><code class="language-cpp">[]( char c ) { return std::isdigit( c, std::locale(&quot;&quot;) ); }
</code></pre>
</blockquote>
<p>Seit es Lambdas gibt, scheint man <code>bind</code> vergessen zu haben.</p>
<pre><code class="language-cpp">std::bind(std::isdigit, _1, std::locale())
</code></pre>
<p>Wahlweise natürlich auch <code>boost::bind</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254272</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254272</guid><dc:creator><![CDATA[ipsec]]></dc:creator><pubDate>Tue, 25 Sep 2012 12:34:17 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 12:46:02 GMT]]></title><description><![CDATA[<p>ipsec schrieb:</p>
<blockquote>
<p>Seit es Lambdas gibt, scheint man <code>bind</code> vergessen zu haben.</p>
</blockquote>
<p>bind gibt es so richtig offiziell ja auch erst, seit es lambdas gibt <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="😉"
    /> . Die Erinnerung an bind1st, not2, const_mem_fun1_ref_t &amp; Co. hat aber wohl jeder schon aus gutem Grund verdrängt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254277</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 25 Sep 2012 12:46:02 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 12:50:31 GMT]]></title><description><![CDATA[<p>Ähhhm ...<br />
das hier:</p>
<pre><code>&quot;465   876  783&quot;
</code></pre>
<p>ist doch auch ein String, der nur ganze Zahlen enthält ... ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254280</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Tue, 25 Sep 2012 12:50:31 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 13:18:42 GMT]]></title><description><![CDATA[<p>Belli schrieb:</p>
<blockquote>
<p>Ähhhm ...<br />
das hier:</p>
<pre><code>&quot;465   876  783&quot;
</code></pre>
<p>ist doch auch ein String, der nur ganze Zahlen enthält ... ?!</p>
</blockquote>
<p>Nope. Streng genommen enthält der neben ganzen Zahlen auch Leerzeichen/Whitespaces.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254291</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 25 Sep 2012 13:18:42 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 13:23:33 GMT]]></title><description><![CDATA[<p>Interessant wird es, wenn ein String mal &quot;6.02E23&quot; oae. lautet. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>ipsec schrieb:</p>
<blockquote>
<p>Seit es Lambdas gibt, scheint man <code>bind</code> vergessen zu haben.</p>
</blockquote>
<p>Ich persoenlich finde Lambdas einfach wesentlich lesbarer als bind. Liegt vielleicht auch an meiner Erfahrung mit anderen Sprachen, aber die Lambdas in C++11 sind einer der Gruende, warum ich jetzt doch manchmal wieder mehr C++ als unbedingt noetig verwende.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254295</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254295</guid><dc:creator><![CDATA[nman]]></dc:creator><pubDate>Tue, 25 Sep 2012 13:23:33 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 13:32:29 GMT]]></title><description><![CDATA[<p>pumuckl schrieb:</p>
<blockquote>
<p>Belli schrieb:</p>
<blockquote>
<p>Ähhhm ...<br />
das hier:</p>
<pre><code>&quot;465   876  783&quot;
</code></pre>
<p>ist doch auch ein String, der nur ganze Zahlen enthält ... ?!</p>
</blockquote>
<p>Nope. Streng genommen enthält der neben ganzen Zahlen auch Leerzeichen/Whitespaces.</p>
</blockquote>
<p>Naja, aber streng genommen ist</p>
<pre><code>&quot;456&quot;
</code></pre>
<p>ein String, der nur <strong>eine</strong> ganze Zahl enthält ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254296</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Tue, 25 Sep 2012 13:32:29 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 16:19:56 GMT]]></title><description><![CDATA[<p>Wieso hat noch keiner</p>
<pre><code class="language-cpp">std::string str(&quot;6846&quot;);
if(str.find_first_not_of(&quot;0123456789&quot;) == std::string::npos)
     std::cout &lt;&lt; &quot;Nur ganze Zahlen!&quot;;
</code></pre>
<p>Das Problem mit den Leerzeichen lässt sich auch ganz einfach einfügen (durch ein zusätzliches Leerzeichen im Parameter von <code>find_...</code> ).</p>
<p>Und was nman meint, da kann man nur noch vom Stream einlesen und diesen nach Fehlern abfragen.<br />
BTW: Ganze Zahlen bestehen auch aus den negativen - ihr meint wohl die Menge <span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>N</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">N_0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.68333em;"></span><span class="strut bottom" style="height:0.83333em;vertical-align:-0.15em;"></span><span class="base textstyle uncramped"><span class="mord"><span class="mord mathit" style="margin-right:0.10903em;">N</span><span class="vlist"><span style="top:0.15em;margin-right:0.05em;margin-left:-0.10903em;"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span><span class="reset-textstyle scriptstyle cramped"><span class="mord mathrm">0</span></span></span><span class="baseline-fix"><span class="fontsize-ensurer reset-size5 size5"><span style="font-size:0em;">​</span></span>​</span></span></span></span></span></span> (Das spezielle N \N geht nicht...).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254330</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Tue, 25 Sep 2012 16:19:56 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 16:36:36 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Wieso hat noch keiner</p>
<pre><code class="language-cpp">std::string str(&quot;6846&quot;);
if(str.find_first_not_of(&quot;0123456789&quot;) == std::string::npos)
     std::cout &lt;&lt; &quot;Nur ganze Zahlen!&quot;;
</code></pre>
</blockquote>
<p>Weil das wieder eine ineffiziente Unsinnslösung ist. Siehe mein Kommentar gestern zu deinem Vorschlag für den armen Kerl mit der Laufschrift. Immerhin hast du dieses Mal wenigstens eine höhere Abstraktionsebene erreicht, da der Code auch zur Überprüfung anderer Kriterien geeignet ist. Dafür hast du nun aber Laufzeitkosten auf dich genommen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /> Tachyons Lösung ist in dem gleichen Stil wie deine, ist aber effektiv das gleiche wie eine naive Prüfschleife elegant geschrieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254340</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 25 Sep 2012 16:36:36 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 17:10:41 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Sone schrieb:</p>
<blockquote>
<p>Wieso hat noch keiner</p>
<pre><code class="language-cpp">std::string str(&quot;6846&quot;);
if(str.find_first_not_of(&quot;0123456789&quot;) == std::string::npos)
     std::cout &lt;&lt; &quot;Nur ganze Zahlen!&quot;;
</code></pre>
</blockquote>
<p>Weil das wieder eine ineffiziente Unsinnslösung ist. Siehe mein Kommentar gestern zu deinem Vorschlag für den armen Kerl mit der Laufschrift. Immerhin hast du dieses Mal wenigstens eine höhere Abstraktionsebene erreicht, da der Code auch zur Überprüfung anderer Kriterien geeignet ist. Dafür hast du nun aber Laufzeitkosten auf dich genommen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /> Tachyons Lösung ist in dem gleichen Stil wie deine, ist aber effektiv das gleiche wie eine naive Prüfschleife elegant geschrieben.</p>
</blockquote>
<p>Ja, hast Recht. Meine ist ca. 1,5 mal langsamer als seine... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254356</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Tue, 25 Sep 2012 17:10:41 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 17:15:26 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Laufzeitkosten</p>
</blockquote>
<p>Wenn es danach geht wuerde ich ja das so machen:</p>
<pre><code class="language-cpp">bool number_string1(char const* p, int length)
{
    return (length==0) ? true : (isdigit(*p) || isspace(*p)) &amp;&amp; number_string1(++p, --length);
}
</code></pre>
<p>Leider schafft es Visual Studio nicht zu optimieren, deswegen muss ihm etwas unter die Arme gegriffen werden:</p>
<pre><code class="language-cpp">bool number_string2(char const* p, int length)
{
    if (length==0) return true;
    if (isdigit(*p) || isspace(*p)) return number_string2(++p, --length);
    return false;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2254359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254359</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Tue, 25 Sep 2012 17:15:26 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 18:24:13 GMT]]></title><description><![CDATA[<p>knivil schrieb:</p>
<blockquote>
<p>SeppJ schrieb:</p>
<blockquote>
<p>Laufzeitkosten</p>
</blockquote>
<p>Wenn es danach geht wuerde ich ja das so machen:</p>
</blockquote>
<p>Na bitte! So sieht eine interessante neue Lösung aus. Hast du das mal mit Tachyons Variante (mit isdigit und isspace mittels Lambda oder Funktor kombiniert) verglichen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254384</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 25 Sep 2012 18:24:13 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Tue, 25 Sep 2012 18:41:45 GMT]]></title><description><![CDATA[<p>Nein. Ich habe mal <code>isspace</code> bei mir weggelassen. Der Unterschied betraegt etwa 10% zu meinen Gunsten bei einem String mit nur Ziffern. SSE bringt VS 2012 bei mir nicht automatisch, daher kann es mit dem GCC anders sein. Natuerlich habe ich es darauf angelegt, dass der Compiler das in eine while-Schleife transformiert. Bei Variante A klappt das leider nicht mit VS 2012. Falls der String nicht nur Ziffern enthaelt hat meine Variante den Vorteil, fruehzeitig abzubrechen. Der naechste Schritt ist natuerlich SSE, aber dazu bedarf es schon riesiger Strings, damit das lohnt. Andere Optimierungsvarianten sind beispielsweise <code>isdigit</code> oder <code>isspace</code> e selbst zu implementieren, damit der Kompiler inlinen kann.</p>
<p>Um mal eine Lanze fuer Sone zu brechen: Seine Loesung finde ich okay.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2254394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2254394</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Tue, 25 Sep 2012 18:41:45 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Thu, 27 Sep 2012 13:21:34 GMT]]></title><description><![CDATA[<p>okay leute ich beschreibe mein problem nochmal... aber danke schonmal für die vielen antworten..</p>
<p>ich schreibe ein elektronisches adressbuch und befasse mich gerade mit der fehlermeldung...um das problem zu lösen das bei der plz genau 5 zahlen eingegeben werden sollen habe ich das so gelößt</p>
<pre><code class="language-cpp">struct Adresse
    string postleitzahl
.........................
char a;
Adresse a;
cout &lt;&lt; &quot;postleitzahl:&quot;;
cin &gt;&gt; a.postleitzahl;
     while(a.postleitzahl.length() != 5)
     { 
      cout &lt;&lt; &quot;falsch\n&quot;;
      cout &lt;&lt; &quot;postleitzahl:&quot;;
      cin &gt;&gt; a.postleitzahl;
      }
..............
datenbank.push_back(a);
</code></pre>
<p>ich frage solange die plz ab bis der string 5 zeichen enthält klappt auch alles sehr gut ich will das selbe jetzt noch einbauen das wenn man statt einer zahl, ein buchstaben eingibt das er auch ne fehlermeldung raus schmeißt und so lange in der while schleife bleibt....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2255020</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2255020</guid><dc:creator><![CDATA[tabtaste]]></dc:creator><pubDate>Thu, 27 Sep 2012 13:21:34 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Thu, 27 Sep 2012 14:08:53 GMT]]></title><description><![CDATA[<p>Und was missfaellt dir an den vorgestellten Loesungen? Wieso passen sie nicht darein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2255046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2255046</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Thu, 27 Sep 2012 14:08:53 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Thu, 27 Sep 2012 14:42:27 GMT]]></title><description><![CDATA[<p>welche der lösungen soll ich denn jetzt nehmen, da stehen ja echt ziemlich viele</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2255064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2255064</guid><dc:creator><![CDATA[tabtaste]]></dc:creator><pubDate>Thu, 27 Sep 2012 14:42:27 GMT</pubDate></item><item><title><![CDATA[Reply to überprüfen ob string = ganzzahl on Thu, 27 Sep 2012 14:50:48 GMT]]></title><description><![CDATA[<p>Die allererste ist schon ok, danach war quasi nur rumgealber, was man anders machen könnte. Du solltest den Rest des Threads aber möglichst auch noch mal vollständig und aufmerksam lesen, da kannst du viel lernen. Außerdem solltest du die vorgeschlagene Lösung auch nicht blind übernehmen, sondern nur, wenn du sie auch verstehst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2255072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2255072</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 27 Sep 2012 14:50:48 GMT</pubDate></item></channel></rss>