<?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[string Inkrementieren]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie der titel schon sagt, will ich einen string inkrementieren. jetzt meine frage, ob das in c++ nur über strinstreams geht.</p>
<p>schöne grüße</p>
<p>gucky</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/279875/string-inkrementieren</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 09:03:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/279875.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Jan 2011 13:06:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:06:40 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie der titel schon sagt, will ich einen string inkrementieren. jetzt meine frage, ob das in c++ nur über strinstreams geht.</p>
<p>schöne grüße</p>
<p>gucky</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002640</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002640</guid><dc:creator><![CDATA[Gucky]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:06:40 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:09:22 GMT]]></title><description><![CDATA[<p>Was verstehst du unter string inkrementieren? Ist std::string gemeint?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002642</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002642</guid><dc:creator><![CDATA[Manni66]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:09:22 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:11:56 GMT]]></title><description><![CDATA[<p>Meinst du string anhand eines Tokens trennen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002644</guid><dc:creator><![CDATA[HighLigerBiMBam]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:11:56 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:12:38 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> Wie stellst du dir das vor? Mit stringstreams scheinst du ja eine Idee davon zu haben, dass würde mich auch interessieren.<br />
Ansonsten einfach den Wert als Zahl halten und nur bei Bedarf in einen String umwandeln. Du kannst auch ständig hin und her umwandeln, wenn das notwendig ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002646</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002646</guid><dc:creator><![CDATA[Paul Müller]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:12:38 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:14:48 GMT]]></title><description><![CDATA[<p>ok ich erklärs kurz:</p>
<pre><code class="language-cpp">string s = &quot;1&quot;;
stringstream ss;
int i;
// jetzt will ich, dass s = 2 wird
ss &lt;&lt; s;
ss &gt;&gt; i;
++i;
// ... und wieder zurück zum string
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2002648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002648</guid><dc:creator><![CDATA[Gucky]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:14:48 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:15:44 GMT]]></title><description><![CDATA[<p>Hin und her umwandeln ist bestimmt nicht schön... Aber wenn es notwendig ein muss naja.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002650</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002650</guid><dc:creator><![CDATA[HighLigerBiMBam]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:15:44 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:19:10 GMT]]></title><description><![CDATA[<p>Und wenn s=&quot;a&quot;? Soll dann &quot;b&quot; rauskommen? Und wenn s=&quot;ab&quot;, was soll dann rauskommen? Und bei s=&quot;19&quot;? Soll dann &quot;20&quot; rauskommen?</p>
<p>Beschreib mal, was das ganze überhaupt soll, dann kann man auch bessere Antworten geben. Bisher sieht es eher nach schlechtem Design aus. Steckt da irgendein Sinn dahinter?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002651</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:19:10 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:29:54 GMT]]></title><description><![CDATA[<p>Meinst du, dass der String eine Zahl beinhaltet, die du inkrementieren willst? In dem Fall ginge stringstream, oder auch boost::lexical_cast.</p>
<p>EDIT:</p>
<pre><code class="language-cpp">string str=&quot;5&quot;;
int n=boost::lexical_cast&lt;int&gt;(str);
str=boost::lexical_cast&lt;string&gt;(++n);
</code></pre>
<p>Oder so, wenn du unbedingt alles in eine Zeile quetschen willst:</p>
<pre><code class="language-cpp">str=boost::lexical_cast&lt;string&gt;((boost::lexical_cast&lt;int&gt;(str))+1);
</code></pre>
<p>So sieht es schon mal schöner aus als mit stringstream. Ob die ganze Sache sinnvoll ist, bleibt aber fragwürdig. SeppJ hat schon Recht. Wieso liegt der Wert (nur) als String vor?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002652</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002652</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:29:54 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:33:57 GMT]]></title><description><![CDATA[<p>Gucky schrieb:</p>
<blockquote>
<p>wie der titel schon sagt, will ich einen string inkrementieren.</p>
</blockquote>
<p>Ich nehme an, dass Dein string die Dezimaldarstellung einer Ganzzahl speichert und dass Du ohne stringstream den String so verändern möchtest, dass er die nächst höhere Ganzzahl repräsentiert.</p>
<p>Gucky schrieb:</p>
<blockquote>
<p>jetzt meine frage, ob das in c++ nur über strinstreams geht.</p>
</blockquote>
<p>Das geht auch ohne stringstream. Eine kleine Funktion zu schreiben, die das macht, ist auch gar nicht so schwer. Du solltest ja wissen, wie man beim Stellenwertsystem von einer auf die nächste Zahl kommt. Du kannst doch zählen, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002664</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002664</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:33:57 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:41:55 GMT]]></title><description><![CDATA[<p>ja ich kann zählen und danke für die antworten, ich habs jetzt so gemacht, dass ich die zahl anfangs als int hab und sie nur einaml am ende in nen string wandeln muss</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002671</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002671</guid><dc:creator><![CDATA[Gucky]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:41:55 GMT</pubDate></item><item><title><![CDATA[Reply to string Inkrementieren on Wed, 05 Jan 2011 13:45:59 GMT]]></title><description><![CDATA[<p>Gucky schrieb:</p>
<blockquote>
<p>ja ich kann zählen und danke für die antworten, ich habs jetzt so gemacht, dass ich die zahl anfangs als int hab und sie nur einaml am ende in nen string wandeln muss</p>
</blockquote>
<p>Das hört sich sinnvoll an!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2002672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2002672</guid><dc:creator><![CDATA[HighLigerBiMBam]]></dc:creator><pubDate>Wed, 05 Jan 2011 13:45:59 GMT</pubDate></item></channel></rss>