<?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[[Hilfe] C Befehle in C++ Befehle umwandeln]]></title><description><![CDATA[<p>Einen wunderschönen.</p>
<p>Ich werkel gerade an einem kleinen Programm welches mir Zufallsnamen ausgeben soll.<br />
Nachdem ich schon 3 mal am verzweifeln war, hat mir ein bekannter ein wenig geholfen und mir einen Code geschrieben, leider jedoch in C.</p>
<p>Mein Problem ist das ich den Code gerne auf C++ angepasst haette.</p>
<pre><code>while(counter&lt;maxnames)
{
 sprintf(firstbuffer, &quot;%s%s%s&quot;,name.erster[rand()%8],name.zweiter[rand()%8],name.dritter[rand()%8]);
 printf(&quot;%s&quot;,firstbuffer);
 savefile &lt;&lt; firstbuffer;
if(rand()%3==0)
{
 sprintf(secondbuffer, &quot;%s&quot;,name.vierter[rand()%8]);
 printf(&quot;%s&quot;,secondbuffer);
 savefile &lt;&lt; secondbuffer;
}
</code></pre>
<p>Das ist der teil den ich irgendwie nicht umschreiben kann <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="😞"
    /><br />
Ich weiss das printf in C++ als cout beschrieben wird, jedoch klappt es nicht wenn ich mit cout den Versuch starte.<br />
Bitte helft mir beim &quot;Übersetzen&quot;.</p>
<p>Liebe Grüße<br />
Matar</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/164281/hilfe-c-befehle-in-c-befehle-umwandeln</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 20:56:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/164281.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 06 Nov 2006 19:08:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [Hilfe] C Befehle in C++ Befehle umwandeln on Mon, 06 Nov 2006 19:08:18 GMT]]></title><description><![CDATA[<p>Einen wunderschönen.</p>
<p>Ich werkel gerade an einem kleinen Programm welches mir Zufallsnamen ausgeben soll.<br />
Nachdem ich schon 3 mal am verzweifeln war, hat mir ein bekannter ein wenig geholfen und mir einen Code geschrieben, leider jedoch in C.</p>
<p>Mein Problem ist das ich den Code gerne auf C++ angepasst haette.</p>
<pre><code>while(counter&lt;maxnames)
{
 sprintf(firstbuffer, &quot;%s%s%s&quot;,name.erster[rand()%8],name.zweiter[rand()%8],name.dritter[rand()%8]);
 printf(&quot;%s&quot;,firstbuffer);
 savefile &lt;&lt; firstbuffer;
if(rand()%3==0)
{
 sprintf(secondbuffer, &quot;%s&quot;,name.vierter[rand()%8]);
 printf(&quot;%s&quot;,secondbuffer);
 savefile &lt;&lt; secondbuffer;
}
</code></pre>
<p>Das ist der teil den ich irgendwie nicht umschreiben kann <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="😞"
    /><br />
Ich weiss das printf in C++ als cout beschrieben wird, jedoch klappt es nicht wenn ich mit cout den Versuch starte.<br />
Bitte helft mir beim &quot;Übersetzen&quot;.</p>
<p>Liebe Grüße<br />
Matar</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1169965</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1169965</guid><dc:creator><![CDATA[Matar]]></dc:creator><pubDate>Mon, 06 Nov 2006 19:08:18 GMT</pubDate></item><item><title><![CDATA[Reply to [Hilfe] C Befehle in C++ Befehle umwandeln on Mon, 06 Nov 2006 19:23:56 GMT]]></title><description><![CDATA[<p>cout &lt;&lt; name.erster[rand()%8] &lt;&lt; name.zweiter[rand()%8]...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1169973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1169973</guid><dc:creator><![CDATA[name:]]></dc:creator><pubDate>Mon, 06 Nov 2006 19:23:56 GMT</pubDate></item><item><title><![CDATA[Reply to [Hilfe] C Befehle in C++ Befehle umwandeln on Mon, 06 Nov 2006 19:49:03 GMT]]></title><description><![CDATA[<p>Auch wenns mir jetzt sehr peinlich ist, bedanke ich mich für die schnelle Hilfe <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="🙂"
    /><br />
Nun siehts huebsch und passend aus.</p>
<p>Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1169992</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1169992</guid><dc:creator><![CDATA[Matar]]></dc:creator><pubDate>Mon, 06 Nov 2006 19:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to [Hilfe] C Befehle in C++ Befehle umwandeln on Mon, 06 Nov 2006 20:01:54 GMT]]></title><description><![CDATA[<p>Und (hoffe, dass das noch aktuell ist <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="😉"
    /> ) du brauchst den Header <em>&lt;ioStream&gt;</em> und cout ist im Namensbereich <em>std</em> definiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1170005</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1170005</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 06 Nov 2006 20:01:54 GMT</pubDate></item></channel></rss>