<?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[Zuweisungsoperator überladen]]></title><description><![CDATA[<p>Hallo ich ein Anfänger was cpp angeht und habe mir als übung eine eigene string klasse genommen.</p>
<p>also</p>
<pre><code class="language-cpp">mystring&amp; operator =(const mystring &amp;z){
...
} Funktioniert

mystring&amp; operator =(char *z){
...
} Funktioniert

friend char* operator =(char *, const mystring&amp;);
GEHT NICHT
</code></pre>
<p>char p*;</p>
<p>mystring str(&quot;hallo&quot;); //GEHT<br />
str = &quot;Huhu&quot;; //GEHT</p>
<p>p = str; //GEHT NICHT</p>
<p>[/cpp]<br />
ich würde gerne</p>
<p>[cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/255157/zuweisungsoperator-überladen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 05:07:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/255157.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Nov 2009 15:28:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zuweisungsoperator überladen on Thu, 26 Nov 2009 15:28:05 GMT]]></title><description><![CDATA[<p>Hallo ich ein Anfänger was cpp angeht und habe mir als übung eine eigene string klasse genommen.</p>
<p>also</p>
<pre><code class="language-cpp">mystring&amp; operator =(const mystring &amp;z){
...
} Funktioniert

mystring&amp; operator =(char *z){
...
} Funktioniert

friend char* operator =(char *, const mystring&amp;);
GEHT NICHT
</code></pre>
<p>char p*;</p>
<p>mystring str(&quot;hallo&quot;); //GEHT<br />
str = &quot;Huhu&quot;; //GEHT</p>
<p>p = str; //GEHT NICHT</p>
<p>[/cpp]<br />
ich würde gerne</p>
<p>[cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1813842</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1813842</guid><dc:creator><![CDATA[gdomod]]></dc:creator><pubDate>Thu, 26 Nov 2009 15:28:05 GMT</pubDate></item><item><title><![CDATA[Reply to Zuweisungsoperator überladen on Thu, 26 Nov 2009 15:33:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Das geht nicht. Du kannst den zuweisungsoperator für Standarddatentypen nicht überladen. Global darf der ja sowieso nicht sein.<br />
Bastel dir dafür eine Memberfunktion.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1813846</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1813846</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 26 Nov 2009 15:33:30 GMT</pubDate></item><item><title><![CDATA[Reply to Zuweisungsoperator überladen on Thu, 26 Nov 2009 15:34:58 GMT]]></title><description><![CDATA[<p>Ein benutzerdefinierter Zuweisungsoperator <em>muss immer</em> eine Elementfunktion sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1813848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1813848</guid><dc:creator><![CDATA[Sebastian Pizer]]></dc:creator><pubDate>Thu, 26 Nov 2009 15:34:58 GMT</pubDate></item></channel></rss>