<?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[Objekt kopieren]]></title><description><![CDATA[<p>wie kann ich eine objekt mit inhalt kopieren?<br />
der strukt sieht folgendermaßen aus:</p>
<pre><code class="language-cpp">typedef struct  {
	     uint Width;
	     uint Height;
	     uint Depth;
	     QGLColormap *Colormap;
	     int VoxelWidth;
	     int VoxelHeight;
	     int VoxelDepth;
	     uint Value;
	  } Volume;
</code></pre>
<p>also z.B. ich hab das object Volumen1 und möchte es in Volumen 2 kopieren<br />
Danke!</p>
<p>Lg Devil's Daughter</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/143595/objekt-kopieren</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 06:48:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/143595.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 10 Apr 2006 06:49:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Objekt kopieren on Mon, 10 Apr 2006 06:49:07 GMT]]></title><description><![CDATA[<p>wie kann ich eine objekt mit inhalt kopieren?<br />
der strukt sieht folgendermaßen aus:</p>
<pre><code class="language-cpp">typedef struct  {
	     uint Width;
	     uint Height;
	     uint Depth;
	     QGLColormap *Colormap;
	     int VoxelWidth;
	     int VoxelHeight;
	     int VoxelDepth;
	     uint Value;
	  } Volume;
</code></pre>
<p>also z.B. ich hab das object Volumen1 und möchte es in Volumen 2 kopieren<br />
Danke!</p>
<p>Lg Devil's Daughter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034246</guid><dc:creator><![CDATA[Devil&#x27;s Daughter]]></dc:creator><pubDate>Mon, 10 Apr 2006 06:49:07 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt kopieren on Mon, 10 Apr 2006 06:54:54 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>erstmal programmierst du ab jetzt C++ <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="😉"
    /> Dann überlädst du den Zuweisungs-operator:</p>
<pre><code class="language-cpp">struct Volume  {
  uint Width;
  uint Height;
  uint Depth;
  QGLColormap *Colormap;
  int VoxelWidth;
  int VoxelHeight;
  int VoxelDepth;
  uint Value;

  Volume&amp; operator=(const Volume &amp;rhs) {
    this-&gt;Width = rhs.Width;
    //usw.

    return *this;
  }
}; 

//Jetzt kannst schreiben:
Volume v1, v2;

v1 = v2; //kopiere v2 in v1
</code></pre>
<p>Siehe auch: <a href="http://tutorial.schornboeck.net/operatoren_ueberladung.htm" rel="nofollow">http://tutorial.schornboeck.net/operatoren_ueberladung.htm</a></p>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034247</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Mon, 10 Apr 2006 06:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt kopieren on Mon, 10 Apr 2006 06:57:34 GMT]]></title><description><![CDATA[<p>Vielen Dank!</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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034248</guid><dc:creator><![CDATA[Devil&#x27;s Daughter]]></dc:creator><pubDate>Mon, 10 Apr 2006 06:57:34 GMT</pubDate></item><item><title><![CDATA[Reply to Objekt kopieren on Mon, 10 Apr 2006 07:07:36 GMT]]></title><description><![CDATA[<p>Und solange du keine tiefe Kopie für den Zeiger &quot;Colormap&quot; verwenden willst, reicht auch der vom Compiler erzeugte Zuweisungsoperator aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1034254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1034254</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 10 Apr 2006 07:07:36 GMT</pubDate></item></channel></rss>