<?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[ausnullen]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich hab grad ne kleine Denkblockade und vielleicht kann mir jemand kurz helfen.</p>
<p>Ich habe Strings mit verschiedenen Längen (1-8 Zeichen). Der String soll aber IMMER 8 Zeichen lang sein und wenn er kürzer ist sollen hinten soweit Zeichen(&quot;0&quot;) angehängt werden bis er diese Länge erreicht.</p>
<p>Wer weiß wies geht? <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/122790/ausnullen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 07:17:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/122790.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Oct 2005 08:10:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 08:10:40 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich hab grad ne kleine Denkblockade und vielleicht kann mir jemand kurz helfen.</p>
<p>Ich habe Strings mit verschiedenen Längen (1-8 Zeichen). Der String soll aber IMMER 8 Zeichen lang sein und wenn er kürzer ist sollen hinten soweit Zeichen(&quot;0&quot;) angehängt werden bis er diese Länge erreicht.</p>
<p>Wer weiß wies geht? <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/888599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888599</guid><dc:creator><![CDATA[Dirki]]></dc:creator><pubDate>Mon, 10 Oct 2005 08:10:40 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 08:53:52 GMT]]></title><description><![CDATA[<p>Woher weißt du wie lang der String ist?</p>
<pre><code class="language-cpp">for (size_t i=laenge; i&lt;8; ++i) {
   dasFeld[i] = 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/888620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888620</guid><dc:creator><![CDATA[Helium]]></dc:creator><pubDate>Mon, 10 Oct 2005 08:53:52 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 09:03:10 GMT]]></title><description><![CDATA[<p>Na das sind die Ergebnisse einer Berechnung...in Hexform aber als String.</p>
<p>Bsp.: 1.Ergebnis 5DC00 ---&gt; += &quot;000&quot;<br />
2.Ergebnis 4F ---&gt; += &quot;000000&quot;</p>
<p>So in etwa...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888630</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888630</guid><dc:creator><![CDATA[Dirki]]></dc:creator><pubDate>Mon, 10 Oct 2005 09:03:10 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 09:11:55 GMT]]></title><description><![CDATA[<p>Das hat damit zu tun, dass ich den Wert in 4*2 Blöcken auf einen EEPROM schicken will. Und der Formalismus verlangt eben solches...Kommunikation is fertig aber mit den blöden Stringrumgebaue habsch so meine Probleme. Ich will mir halt aus der einfachen Zahl die Befehlskette zusammenbasteln..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888638</guid><dc:creator><![CDATA[Dirki]]></dc:creator><pubDate>Mon, 10 Oct 2005 09:11:55 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 09:17:47 GMT]]></title><description><![CDATA[<p>schau dir lieber mal die Spezifikationen fuer sprintf(snprintf,_snprintf unter windows) an ...</p>
<pre><code class="language-cpp">char strTest[9]; 
unsigned int iTest = 0xABC;
_snprintf(strTest,9,&quot;%8.8X&quot;,iTest);
</code></pre>
<p>Iss vielleicht schon das was du suchst ...</p>
<p>Ciao ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888643</guid><dc:creator><![CDATA[RHBaum]]></dc:creator><pubDate>Mon, 10 Oct 2005 09:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 09:18:16 GMT]]></title><description><![CDATA[<p>String Ströme</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888644</guid><dc:creator><![CDATA[joooo]]></dc:creator><pubDate>Mon, 10 Oct 2005 09:18:16 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 09:31:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/3842">@RHBaum</a></p>
<p>Halt dich ma nich an den Hexzahlen fest...das hab ich schon längst erledigt.<br />
Es geht nur darum die Strings in eine einheitliche Länge zu bringen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888656</guid><dc:creator><![CDATA[Dirki]]></dc:creator><pubDate>Mon, 10 Oct 2005 09:31:20 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 10:54:18 GMT]]></title><description><![CDATA[<p>Ah, du willst '0' und nicht 0. OK.<br />
[cpp]<br />
for (size_t i=laenge; i&lt;8; ++i) {<br />
dasFeld[i] = '0';<br />
}<br />
dasFeld[8] = '\0';<br />
[cpp]</p>
<p>laenge entspricht der bisherigen Stringlänge</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888701</guid><dc:creator><![CDATA[Helium]]></dc:creator><pubDate>Mon, 10 Oct 2005 10:54:18 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 11:27:30 GMT]]></title><description><![CDATA[<blockquote>
<p>Es geht nur darum die Strings in eine einheitliche Länge zu bringen.</p>
</blockquote>
<p>Naja, ich wuerd halt versuchen, die strings von anfang an in der lanege zu halten , wenn du richtig naerrich drauf bist,koenntest gar ne eigene klasse fuer schreiben ...</p>
<p>Um schnell strings aufzufuellen ohne ne schleife zu nutzen, kannst memset verwenden ala,</p>
<pre><code class="language-cpp">char buffer[9];
strcpy(buffer,&quot;123&quot;);
memset(&amp;buffer[3],'0',sizeof(char) * 5);
buffer[8] = 0;
</code></pre>
<p>funzt dann aber nur so mit 1 byte grossen zeichensatz, fuer unicode musst dir was anderes einfallen lassen ...</p>
<p>Ciao ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/888723</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888723</guid><dc:creator><![CDATA[RHBaum]]></dc:creator><pubDate>Mon, 10 Oct 2005 11:27:30 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 11:40:48 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::ostringstream output;
output &lt;&lt; std::setw(8) &lt;&lt; std::setfill('0') &lt;&lt; std::left &lt;&lt; &quot;Hallo&quot;;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/888728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888728</guid><dc:creator><![CDATA[Hallo!]]></dc:creator><pubDate>Mon, 10 Oct 2005 11:40:48 GMT</pubDate></item><item><title><![CDATA[Reply to ausnullen on Mon, 10 Oct 2005 12:44:55 GMT]]></title><description><![CDATA[<p>So danke an alle...</p>
<p>Ich machs jetzt mit GetLength() und str.Insert. Dat is mir jetzt das einfachste für meinen Fall...</p>
<p><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="🙂"
    /> <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/888816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/888816</guid><dc:creator><![CDATA[Dirki]]></dc:creator><pubDate>Mon, 10 Oct 2005 12:44:55 GMT</pubDate></item></channel></rss>