<?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[Zahl in String&#x2F;Array of Char umwandeln]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte für mein Programm eine Zahl in ein Array of Char schreiben.<br />
Ich bin da echt am verzweifeln, weil absolut nichts funktioniert, was ich probiert hab. Das mMn sinnvollste poste ich einfach mal hier:</p>
<pre><code class="language-cpp">int d;
   for(int c = 0;c &lt; sizeof(a);+cc) {
    // Zahl in Char umwandeln
    d = char( + 48);
    char[c] = d;
    char[c+1] = '\0';   
   }
   Text-&gt;SetLabel(wxT(text));
</code></pre>
<p>Meine Idee:<br />
Ich übersetzte jede einzelnde Ziffer nacheinander und packe sie in das Array of Char. Leider weiß ich nicht so recht, wie ich das Teilstück eines Integers ermitteln kann, dass ich benötige. Es gibt für Strings ja substr (oder sowas in der Art), aber was gibt es da für Zahlen?</p>
<p>Oder gibt es sonst noch bessere Methoden, um eine Zahl in einen String zu verwandeln?<br />
Mit &quot;cout &lt;&lt; a &lt;&lt; '...' &lt;&lt; '\n';&quot; funktioniert es nicht, da es keine Konsolenanwendung ist, sondern eben ein Programm mit GUI.</p>
<p>Danke schonmal <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>
]]></description><link>https://www.c-plusplus.net/forum/topic/264496/zahl-in-string-array-of-char-umwandeln</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 18:00:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/264496.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Apr 2010 13:36:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zahl in String&#x2F;Array of Char umwandeln on Thu, 08 Apr 2010 13:37:03 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte für mein Programm eine Zahl in ein Array of Char schreiben.<br />
Ich bin da echt am verzweifeln, weil absolut nichts funktioniert, was ich probiert hab. Das mMn sinnvollste poste ich einfach mal hier:</p>
<pre><code class="language-cpp">int d;
   for(int c = 0;c &lt; sizeof(a);+cc) {
    // Zahl in Char umwandeln
    d = char( + 48);
    char[c] = d;
    char[c+1] = '\0';   
   }
   Text-&gt;SetLabel(wxT(text));
</code></pre>
<p>Meine Idee:<br />
Ich übersetzte jede einzelnde Ziffer nacheinander und packe sie in das Array of Char. Leider weiß ich nicht so recht, wie ich das Teilstück eines Integers ermitteln kann, dass ich benötige. Es gibt für Strings ja substr (oder sowas in der Art), aber was gibt es da für Zahlen?</p>
<p>Oder gibt es sonst noch bessere Methoden, um eine Zahl in einen String zu verwandeln?<br />
Mit &quot;cout &lt;&lt; a &lt;&lt; '...' &lt;&lt; '\n';&quot; funktioniert es nicht, da es keine Konsolenanwendung ist, sondern eben ein Programm mit GUI.</p>
<p>Danke schonmal <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1879373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1879373</guid><dc:creator><![CDATA[P7BB]]></dc:creator><pubDate>Thu, 08 Apr 2010 13:37:03 GMT</pubDate></item><item><title><![CDATA[Reply to Zahl in String&#x2F;Array of Char umwandeln on Thu, 08 Apr 2010 13:38:48 GMT]]></title><description><![CDATA[<p>[quote=&quot;P7BB&quot;9Leider weiß ich nicht so recht, wie ich das Teilstück eines Integers ermitteln kann, dass ich benötige. Es gibt für Strings ja substr (oder sowas in der Art), aber was gibt es da für Zahlen?[/quote]</p>
<p>Da gibt es in der Tat etwas. Das nennt sich Mathematik.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1879376</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1879376</guid><dc:creator><![CDATA[Janjan]]></dc:creator><pubDate>Thu, 08 Apr 2010 13:38:48 GMT</pubDate></item><item><title><![CDATA[Reply to Zahl in String&#x2F;Array of Char umwandeln on Thu, 08 Apr 2010 13:39:51 GMT]]></title><description><![CDATA[<p>Mathematik braucht man aber nicht, wenn man einfach das nimmt, was C++ schon hat:</p>
<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39488.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39488.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1879378</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1879378</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 08 Apr 2010 13:39:51 GMT</pubDate></item><item><title><![CDATA[Reply to Zahl in String&#x2F;Array of Char umwandeln on Thu, 08 Apr 2010 14:21:50 GMT]]></title><description><![CDATA[<p>Danke. <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1879416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1879416</guid><dc:creator><![CDATA[P7BB]]></dc:creator><pubDate>Thu, 08 Apr 2010 14:21:50 GMT</pubDate></item></channel></rss>