<?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[Inhalt von char s umgekehrt in char z speichern]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Ich müßte den Inhalt von</p>
<p>char s[24] = Suppenkessel;</p>
<p>umgekehrt in</p>
<p>char z[24];</p>
<p>speichern und char z ausgeben.</p>
<p>---------------------------------</p>
<p>Ergebnis: char z: lessekneppuS</p>
<p>Welche Möglichkeiten gibt es?</p>
<p>Danke</p>
<p>Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/169967/inhalt-von-char-s-umgekehrt-in-char-z-speichern</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 22:13:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/169967.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Jan 2007 15:38:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 15:38:57 GMT]]></title><description><![CDATA[<p>Hallo zusammen!</p>
<p>Ich müßte den Inhalt von</p>
<p>char s[24] = Suppenkessel;</p>
<p>umgekehrt in</p>
<p>char z[24];</p>
<p>speichern und char z ausgeben.</p>
<p>---------------------------------</p>
<p>Ergebnis: char z: lessekneppuS</p>
<p>Welche Möglichkeiten gibt es?</p>
<p>Danke</p>
<p>Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207203</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207203</guid><dc:creator><![CDATA[chrbusch]]></dc:creator><pubDate>Wed, 10 Jan 2007 15:38:57 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 15:52:24 GMT]]></title><description><![CDATA[<p><a href="http://www.cppreference.com/cppalgorithm/reverse_copy.html" rel="nofollow">http://www.cppreference.com/cppalgorithm/reverse_copy.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207211</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207211</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Wed, 10 Jan 2007 15:52:24 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 16:01:54 GMT]]></title><description><![CDATA[<p>Danke.</p>
<p>Wie soll ich den Code:</p>
<p>#include &lt;algorithm&gt;<br />
iterator reverse_copy( iterator start, iterator end, iterator result );</p>
<p>hier einfügen:</p>
<p>#include &lt;iostream&gt;</p>
<p>int main()</p>
<p>{<br />
int index = 3;</p>
<p>char s[24] = &quot;Bubbelmaul&quot;;<br />
char z[24];</p>
<p>strcpy(z, s);</p>
<p>char<em>ps = s;<br />
char</em>pz = z;</p>
<p>std::cout &lt;&lt;&quot;Char *ps: &quot; &lt;&lt; ps &lt;&lt;&quot;\n&quot;;<br />
std::cout &lt;&lt;&quot;Char *pz: &quot; &lt;&lt; pz;</p>
<p>return 0;</p>
<p>}</p>
<p>Grüße</p>
<p>Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207227</guid><dc:creator><![CDATA[chrbusch]]></dc:creator><pubDate>Wed, 10 Jan 2007 16:01:54 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 16:15:46 GMT]]></title><description><![CDATA[<p>evtl. so</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;algorithm&gt;

int main()
{
char s[24] = &quot;Bubbelmaul&quot;;
char z[24];
reverse_copy( s, s+strlen(s), z ); 

std::cout &lt;&lt;&quot;Char *ps: &quot; &lt;&lt; s &lt;&lt;&quot;\n&quot;;
std::cout &lt;&lt;&quot;Char *pz: &quot; &lt;&lt; z;

return 0;

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1207240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207240</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 10 Jan 2007 16:15:46 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 16:25:04 GMT]]></title><description><![CDATA[<p>Folgende Fehlermeldung:</p>
<p>E2268 Aufruf der undefinierten Funktion 'reverse_copy' in Funktion main() in Zeile 8</p>
<p>Grüße</p>
<p>Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207251</guid><dc:creator><![CDATA[chrbusch]]></dc:creator><pubDate>Wed, 10 Jan 2007 16:25:04 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 16:28:54 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">std::reverse_copy(...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1207256</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207256</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 10 Jan 2007 16:28:54 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 16:36:03 GMT]]></title><description><![CDATA[<p>Vielen Dank an</p>
<p>Braunstein und Artchi.</p>
<p>Jetzt noch 2 letzte Fragen (Sorry):</p>
<ol>
<li>Warum wird das &quot;@&quot; mit ausgegeben?</li>
</ol>
<p>Out:<br />
Char *ps: Bubbelmaul</p>
<p>Char *pz: luamlebbuB@</p>
<ol start="2">
<li>Könnte ich bitte eine kurze Erklärung bekommen?<br />
Ich verstehe den Ausdruck: --&gt;s+strlen(s)&lt;-- nicht.<br />
OK: s ist char s - aber +strlen(s)?</li>
</ol>
<p>Danke</p>
<p>Chris</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207262</guid><dc:creator><![CDATA[chrbusch]]></dc:creator><pubDate>Wed, 10 Jan 2007 16:36:03 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 16:50:27 GMT]]></title><description><![CDATA[<p>chrbusch schrieb:</p>
<blockquote>
<p>Vielen Dank an</p>
<p>Braunstein und Artchi.</p>
<p>Jetzt noch 2 letzte Fragen (Sorry):</p>
<ol>
<li>Warum wird das &quot;@&quot; mit ausgegeben?</li>
</ol>
<p>Out:<br />
Char *ps: Bubbelmaul</p>
<p>Char *pz: luamlebbuB@</p>
<ol start="2">
<li>Könnte ich bitte eine kurze Erklärung bekommen?<br />
Ich verstehe den Ausdruck: --&gt;s+strlen(s)&lt;-- nicht.<br />
OK: s ist char s - aber +strlen(s)?</li>
</ol>
<p>Danke</p>
<p>Chris</p>
</blockquote>
<ol>
<li>Weil das was da oben steht falsch ist.</li>
<li>Mach es lieber so wie ihr es gelernt habt und ohne STL. Ich bin mir sicher das ist nicht die geforderte Variante. Du brauchst eine Funktion void reversen(const char* in, char* out, unsigned max);</li>
</ol>
]]></description><link>https://www.c-plusplus.net/forum/post/1207276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207276</guid><dc:creator><![CDATA[Entenwickler]]></dc:creator><pubDate>Wed, 10 Jan 2007 16:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 17:11:45 GMT]]></title><description><![CDATA[<p>chrbusch schrieb:</p>
<blockquote>
<ol>
<li>Warum wird das &quot;@&quot; mit ausgegeben?</li>
</ol>
</blockquote>
<p>Weil die Nullterminierung des Strings fehlt. Folgendermaßen kann man sie hinzufügen:</p>
<pre><code class="language-cpp">pz[strlen(ps)] = '\0';
</code></pre>
<p>Prinzipiell müsste es auch reichen, einfach ein Zeichen mehr zu kopieren, das klappt bei mir aber komischerweise nicht.</p>
<blockquote>
<ol start="2">
<li>Könnte ich bitte eine kurze Erklärung bekommen?<br />
Ich verstehe den Ausdruck: --&gt;s+strlen(s)&lt;-- nicht.<br />
OK: s ist char s - aber +strlen(s)?</li>
</ol>
</blockquote>
<p>Das ist ein Zeiger hinter das letzte Zeichen des Strings. 'reverse_copy' benötigt einen Bereich zum Kopieren, also einen Start-Zeiger und einen End-Zeiger. Es kopiert dann den Bereich vom Start bis vor das Ende.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207288</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Wed, 10 Jan 2007 17:11:45 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 17:20:01 GMT]]></title><description><![CDATA[<p>Konrad Rudolph schrieb:</p>
<blockquote>
<p>Prinzipiell müsste es auch reichen, einfach ein Zeichen mehr zu kopieren, das klappt bei mir aber komischerweise nicht.</p>
</blockquote>
<p>Würde dann nicht das Nullbyte an erster Stelle stehen?;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207297</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207297</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Wed, 10 Jan 2007 17:20:01 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 17:28:42 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>Konrad Rudolph schrieb:</p>
<blockquote>
<p>Prinzipiell müsste es auch reichen, einfach ein Zeichen mehr zu kopieren, das klappt bei mir aber komischerweise nicht.</p>
</blockquote>
<p>Würde dann nicht das Nullbyte an erster Stelle stehen?;)</p>
</blockquote>
<p>Ja, dieser Gedanke erklärt so einiges. <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207304</guid><dc:creator><![CDATA[Konrad Rudolph]]></dc:creator><pubDate>Wed, 10 Jan 2007 17:28:42 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 17:46:28 GMT]]></title><description><![CDATA[<p>oder so:</p>
<pre><code>void rev_string (char *in, char *out)
{
   char *p = out + strlen(in);
   *p = 0;
   while (p-out) 
      *--p = *in++;
}
</code></pre>
<p><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="😉"
    /> :xmas2:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207314</guid><dc:creator><![CDATA[ten]]></dc:creator><pubDate>Wed, 10 Jan 2007 17:46:28 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 17:53:25 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>Konrad Rudolph schrieb:</p>
<blockquote>
<p>Prinzipiell müsste es auch reichen, einfach ein Zeichen mehr zu kopieren, das klappt bei mir aber komischerweise nicht.</p>
</blockquote>
<p>Würde dann nicht das Nullbyte an erster Stelle stehen?;)</p>
</blockquote>
<p>Hähä, habe mich auch gewundert. *klatsch an den kopf* Ja ja, die C-Style Strings sind der Hammer. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207319</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207319</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Wed, 10 Jan 2007 17:53:25 GMT</pubDate></item><item><title><![CDATA[Reply to Inhalt von char s umgekehrt in char z speichern on Wed, 10 Jan 2007 18:21:52 GMT]]></title><description><![CDATA[<p>nt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1207346</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1207346</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Wed, 10 Jan 2007 18:21:52 GMT</pubDate></item></channel></rss>