<?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[strcpy mit param char* dest und return char*]]></title><description><![CDATA[<p>msdn</p>
<blockquote>
<p>char *strcpy( char *strDestination, const char *strSource );<br />
Return Value</p>
<p>Each of these functions returns the destination string. No return value is reserved to indicate an error.</p>
<p>Parameters</p>
<p>strDestination</p>
<p>Destination string</p>
<p>strSource</p>
<p>Null-terminated source string</p>
</blockquote>
<p>hier wird call by reference verwendet, wieso return char*? return value ist doch genau der pointer zu strDestination.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/190680/strcpy-mit-param-char-dest-und-return-char</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 19:45:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/190680.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Aug 2007 11:47:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 11:47:40 GMT]]></title><description><![CDATA[<p>msdn</p>
<blockquote>
<p>char *strcpy( char *strDestination, const char *strSource );<br />
Return Value</p>
<p>Each of these functions returns the destination string. No return value is reserved to indicate an error.</p>
<p>Parameters</p>
<p>strDestination</p>
<p>Destination string</p>
<p>strSource</p>
<p>Null-terminated source string</p>
</blockquote>
<p>hier wird call by reference verwendet, wieso return char*? return value ist doch genau der pointer zu strDestination.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1351748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1351748</guid><dc:creator><![CDATA[netrobot]]></dc:creator><pubDate>Sat, 25 Aug 2007 11:47:40 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 20:09:07 GMT]]></title><description><![CDATA[<p>netrobot schrieb:</p>
<blockquote>
<p>msdn</p>
<blockquote>
<p>char *strcpy( char *strDestination, const char *strSource );<br />
Return Value</p>
<p>Each of these functions returns the destination string. No return value is reserved to indicate an error.</p>
<p>Parameters</p>
<p>strDestination</p>
<p>Destination string</p>
<p>strSource</p>
<p>Null-terminated source string</p>
</blockquote>
<p>hier wird call by reference verwendet, wieso return char*? return value ist doch genau der pointer zu strDestination.</p>
</blockquote>
<p>Was auch immer mit &quot;No return value&quot; gemeint ist. Sehr strange, deren Definition.</p>
<p>Zu deiner Frage, hier wird nicht call by reference gemacht. Zeiger werden by value<br />
uebergeben. Der zurueckgegebene Zeiger sollte auf strDestination zeigen.</p>
<p>gruss<br />
v R</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352027</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352027</guid><dc:creator><![CDATA[virtuell Realisticer]]></dc:creator><pubDate>Sat, 25 Aug 2007 20:09:07 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 21:15:45 GMT]]></title><description><![CDATA[<p>virtuell Realisticer schrieb:</p>
<blockquote>
<p>Was auch immer mit &quot;No return value&quot; gemeint ist. Sehr strange, deren Definition.</p>
</blockquote>
<p>&quot;No return value <strong>is reserved to indicate an error</strong>.&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352060</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352060</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Sat, 25 Aug 2007 21:15:45 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 21:34:14 GMT]]></title><description><![CDATA[<blockquote>
<p>Der zurueckgegebene Zeiger sollte auf strDestination zeigen.</p>
</blockquote>
<p>ich habe schon den Zeiger auf strDest, wozu noch der zurückgeg. Zeiger?</p>
<blockquote>
<p>&quot;No return value is reserved to indicate an error.&quot;</p>
</blockquote>
<p>es ist nicht so logisch, aber ein argument.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352067</guid><dc:creator><![CDATA[netrobot]]></dc:creator><pubDate>Sat, 25 Aug 2007 21:34:14 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 22:44:37 GMT]]></title><description><![CDATA[<p>finix schrieb:</p>
<blockquote>
<p>virtuell Realisticer schrieb:</p>
<blockquote>
<p>Was auch immer mit &quot;No return value&quot; gemeint ist. Sehr strange, deren Definition.</p>
</blockquote>
<p>&quot;No return value <strong>is reserved to indicate an error</strong>.&quot;</p>
</blockquote>
<p>Ja und? Ist das nun 0? Oder wird ein Zeiger auf eine Birne zurueckgegeben<br />
oder wie schaut das aus?</p>
<p>gruss<br />
v R</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352100</guid><dc:creator><![CDATA[virtuell Realisticer]]></dc:creator><pubDate>Sat, 25 Aug 2007 22:44:37 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 23:00:40 GMT]]></title><description><![CDATA[<p>netrobot schrieb:</p>
<blockquote>
<blockquote>
<p>Der zurueckgegebene Zeiger sollte auf strDestination zeigen.</p>
</blockquote>
<p>ich habe schon den Zeiger auf strDest, wozu noch der zurückgeg. Zeiger?</p>
</blockquote>
<p>weils schon immer so war?</p>
<blockquote>
<p>&quot;No return value is reserved to indicate an error.&quot;</p>
</blockquote>
<p>wohl so gemeint: &quot;There is no return value that would indicate an error.&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352104</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 25 Aug 2007 23:00:40 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 23:29:39 GMT]]></title><description><![CDATA[<p>netrobot schrieb:</p>
<blockquote>
<blockquote>
<p>Der zurueckgegebene Zeiger sollte auf strDestination zeigen.</p>
</blockquote>
<p>ich habe schon den Zeiger auf strDest, wozu noch der zurückgeg. Zeiger?</p>
</blockquote>
<p>Für dies und ähnliches:</p>
<pre><code class="language-cpp">strcat(strcpy(dest, &quot;Hello, &quot;), name);
</code></pre>
<p>netrobot schrieb:</p>
<blockquote>
<blockquote>
<p>&quot;No return value is reserved to indicate an error.&quot;</p>
</blockquote>
<p>es ist nicht so logisch, aber ein argument.</p>
</blockquote>
<p>Es sagt nichts weiter, als dass es keinen Fehler gibt, den strcpy zurückgeben könnte. Deshalb gibt es auch keinen Rückgabewert, der für Fehler reserviert sein müsste.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352110</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sat, 25 Aug 2007 23:29:39 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sat, 25 Aug 2007 23:43:30 GMT]]></title><description><![CDATA[<p>2 strcpy versionen</p>
<pre><code class="language-cpp">1 #include &lt;stdlib.h&gt;
2
3 char *
4 strcpy1 (char *d, char *s)
5 {
6 size_t i;
7
8 for (i = 0; s[i] != 0; ++i)
9 {
10 d[i] = s[i];
11 }
12 d[i] = 0;
13
14 return d;
15 }
</code></pre>
<pre><code>1 #include &lt;stdlib.h&gt;
2
3 char *
4 strcpy2 (char *d, char *s)
5 {
6 char *d1 = d;
7
8 while ((*d1++ = *s++));
9
10 return d;
11 }
</code></pre>
<p>1. in version 1. d und return zeiger sind zwar selber, aber zurückgeg. char* ist 0 terminiert.<br />
2. für 1 und 2 sind plätze jeweils ausserhalb reserviert.<br />
wie kann man einen Fehler feststellen und abfangen, dann return 0?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352112</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352112</guid><dc:creator><![CDATA[netrobot]]></dc:creator><pubDate>Sat, 25 Aug 2007 23:43:30 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 00:32:31 GMT]]></title><description><![CDATA[<p>virtuell Realisticer schrieb:</p>
<blockquote>
<p>finix schrieb:</p>
<blockquote>
<p>&quot;No return value <strong>is reserved to indicate an error</strong>.&quot;</p>
</blockquote>
<p>Ja und? Ist das nun 0? Oder wird ein Zeiger auf eine Birne zurueckgegeben<br />
oder wie schaut das aus?</p>
</blockquote>
<p>Eben nicht. Genau das will dir die Dokumentation sagen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352119</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Sun, 26 Aug 2007 00:32:31 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 00:33:35 GMT]]></title><description><![CDATA[<p>netrobot schrieb:</p>
<blockquote>
<blockquote>
<p>Der zurueckgegebene Zeiger sollte auf strDestination zeigen.</p>
</blockquote>
<p>ich habe schon den Zeiger auf strDest, wozu noch der zurückgeg. Zeiger?</p>
</blockquote>
<p>Damit <code>strcpy</code> praktisch gesehen ein Expression ist, kein Statement.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352121</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352121</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Sun, 26 Aug 2007 00:33:35 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 13:11:45 GMT]]></title><description><![CDATA[<p>finix schrieb:</p>
<blockquote>
<p>virtuell Realisticer schrieb:</p>
<blockquote>
<p>finix schrieb:</p>
<blockquote>
<p>&quot;No return value <strong>is reserved to indicate an error</strong>.&quot;</p>
</blockquote>
<p>Ja und? Ist das nun 0? Oder wird ein Zeiger auf eine Birne zurueckgegeben<br />
oder wie schaut das aus?</p>
</blockquote>
<p>Eben nicht. Genau das will dir die Dokumentation sagen.</p>
</blockquote>
<p>Ist ret != dst?</p>
<p>gruss<br />
v R</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352305</guid><dc:creator><![CDATA[virtuell Realisticer]]></dc:creator><pubDate>Sun, 26 Aug 2007 13:11:45 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 13:44:25 GMT]]></title><description><![CDATA[<p>virtuell Realisticer schrieb:</p>
<blockquote>
<p>Ist ret != dst?</p>
</blockquote>
<p>Was will uns diese Frage sagen? Nein, ret ist immer dst. Was genau verstehst Du denn nicht an der bereits mehrmals getroffenen Aussage: &quot;Es gibt keine Fehler, die strcpy melden könnte, also gibt es auch keinen Rückgabewert, der einen Fehler anzeigen müsste.&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352332</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352332</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sun, 26 Aug 2007 13:44:25 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 14:12:57 GMT]]></title><description><![CDATA[<blockquote>
<p>No return value is reserved to indicate an error.</p>
</blockquote>
<p>versteh ich eher so, dass die implementierung 0 zurück gibt, wenn nen fehler auftritt. entspricht allerdings nicht der standardimplementierung von strcpy, deren rückgabewert immer *dest ist.</p>
<p>sinn machen kann das allerdings schon. z.b. wenn aus irgendeinem grund kein zugriff auf *dest stattfinden kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352351</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Sun, 26 Aug 2007 14:12:57 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 14:38:40 GMT]]></title><description><![CDATA[<p>&quot;No return value&quot; ist ja nicht möglich, wenn der Funktionstyp nicht void ist, selbst 0 wäre ja ein Rückgabewert... <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>
<p>Grüße,</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352369</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352369</guid><dc:creator><![CDATA[JimmydaMage]]></dc:creator><pubDate>Sun, 26 Aug 2007 14:38:40 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 14:46:46 GMT]]></title><description><![CDATA[<p>es wird allerdings ein *char zurückgegeben. d.h. der value ist ein array von chars. ein leeres array wäre eine gültige adresse auf einen speicherbereich, in dem 0 steht. &quot;kein wert&quot; ist keine adresse, also 0 <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/1352375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352375</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Sun, 26 Aug 2007 14:46:46 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 15:38:16 GMT]]></title><description><![CDATA[<p>Sagt mal ist das hier eine sprachliche Diskussion oder eine fachliche? Der Satz sagt <strong>eindeutig</strong>, dass keinen Returnwert gibt, der einen Fehler anzeigt. Er sagt <strong>nicht</strong>, dass es keinen Return-Wert gibt, er sagt <strong>nicht</strong>, dass im Fehlerfall 0 zurückgegeben wird.</p>
<p>Wenn es einfach daran liegt, dass Euer Englisch nicht so gut ist, nachvollziehbar. Aber vertraut doch einfach mal den paar Leuten die diesen Satz hier mehrmals auseinandergebröselt und erklärt haben.</p>
<p>&quot;Es gibt <strong>keinen</strong> Returnwert, <strong>der einen Fehler anzeigt</strong>.&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352410</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352410</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sun, 26 Aug 2007 15:38:16 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Sun, 26 Aug 2007 16:40:56 GMT]]></title><description><![CDATA[<p>Ich hab reserved ueberlesen</p>
<p>gruss<br />
v R</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352433</guid><dc:creator><![CDATA[virtuell Realisticer]]></dc:creator><pubDate>Sun, 26 Aug 2007 16:40:56 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Mon, 27 Aug 2007 05:51:21 GMT]]></title><description><![CDATA[<p>LordJaxom schrieb:</p>
<blockquote>
<p>Sagt mal ist das hier eine sprachliche Diskussion oder eine fachliche? Der Satz sagt <strong>eindeutig</strong>, dass keinen Returnwert gibt, der einen Fehler anzeigt. Er sagt <strong>nicht</strong>, dass es keinen Return-Wert gibt, er sagt <strong>nicht</strong>, dass im Fehlerfall 0 zurückgegeben wird.</p>
<p>Wenn es einfach daran liegt, dass Euer Englisch nicht so gut ist, nachvollziehbar. Aber vertraut doch einfach mal den paar Leuten die diesen Satz hier mehrmals auseinandergebröselt und erklärt haben.</p>
<p>&quot;Es gibt <strong>keinen</strong> Returnwert, <strong>der einen Fehler anzeigt</strong>.&quot;</p>
</blockquote>
<p>das sagt er nicht eindeutig.</p>
<blockquote>
<p>No return value is reserved to indicate an error.</p>
</blockquote>
<p>eine korrekte übersetzung lautet:<br />
Kein Rückgabewert ist reserviert, um einen Fehler anzuzeigen.</p>
<p>dass die von dir genannte übersetzung auch richtig sein kann stell ich gar nicht in abrede. aber in dem fall hier ist der satz allein nicht eindeutig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1352694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352694</guid><dc:creator><![CDATA[thordk]]></dc:creator><pubDate>Mon, 27 Aug 2007 05:51:21 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Mon, 27 Aug 2007 05:53:39 GMT]]></title><description><![CDATA[<p>thordk schrieb:</p>
<blockquote>
<p>eine korrekte übersetzung lautet:<br />
Kein Rückgabewert ist reserviert, um einen Fehler anzuzeigen.</p>
</blockquote>
<p>Irgendwie schaffe ich es dennoch nicht, diesen Satz (selbst auf Deutsch) anders zu interpretieren, als dass es keinen Rückgabewert gibt, der einen Fehler anzeigt <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/1352696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1352696</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 27 Aug 2007 05:53:39 GMT</pubDate></item><item><title><![CDATA[Reply to strcpy mit param char* dest und return char* on Mon, 27 Aug 2007 13:40:30 GMT]]></title><description><![CDATA[<p>thordk schrieb:</p>
<blockquote>
<blockquote>
<p>No return value is reserved to indicate an error.</p>
</blockquote>
<p>eine korrekte übersetzung lautet:<br />
Kein Rückgabewert ist reserviert, um einen Fehler anzuzeigen.</p>
</blockquote>
<p>Und was schließt du daraus? <code>if (error) return (char*)rand();</code> ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1353055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1353055</guid><dc:creator><![CDATA[finix]]></dc:creator><pubDate>Mon, 27 Aug 2007 13:40:30 GMT</pubDate></item></channel></rss>