<?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[Klasse als rückgabetyp]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich wollte nur mal fragen, ob es überhaupt möglich ist, eine klasse als rückgabetyp zu verwenden, ungefähr so:</p>
<pre><code>class Tree
{
  public:
   /....
};

Tree findTree (string s)
{
  /....
  Tree tanne=........;
  return tanne;
}
int main()
{
Tree t=findTree(&quot;baum&quot;);
}
</code></pre>
<p>ich bekomme immer beim aufruf von findTree einen error:<br />
&quot;conversion from Tree to non-scalar&quot;</p>
<p>Kann mir jemand helfen?<br />
mfg kobauder</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/160503/klasse-als-rückgabetyp</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 08:06:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/160503.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Sep 2006 13:25:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Klasse als rückgabetyp on Tue, 26 Sep 2006 13:25:44 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich wollte nur mal fragen, ob es überhaupt möglich ist, eine klasse als rückgabetyp zu verwenden, ungefähr so:</p>
<pre><code>class Tree
{
  public:
   /....
};

Tree findTree (string s)
{
  /....
  Tree tanne=........;
  return tanne;
}
int main()
{
Tree t=findTree(&quot;baum&quot;);
}
</code></pre>
<p>ich bekomme immer beim aufruf von findTree einen error:<br />
&quot;conversion from Tree to non-scalar&quot;</p>
<p>Kann mir jemand helfen?<br />
mfg kobauder</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144748</guid><dc:creator><![CDATA[kobauder]]></dc:creator><pubDate>Tue, 26 Sep 2006 13:25:44 GMT</pubDate></item><item><title><![CDATA[Reply to Klasse als rückgabetyp on Tue, 26 Sep 2006 14:39:28 GMT]]></title><description><![CDATA[<p>Ja, dein Code ist ok. Vorausgesetzt Tree hat einen Copy-Konstruktor geht das so.</p>
<p>Edit: Sorry, hab die Zeile mit der Fehlermeldung übersehen. Vielleicht einmal ein Bißchen mehr Code zeigen, dann können wir dir auch helfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144763</guid><dc:creator><![CDATA[Z2]]></dc:creator><pubDate>Tue, 26 Sep 2006 14:39:28 GMT</pubDate></item><item><title><![CDATA[Reply to Klasse als rückgabetyp on Tue, 26 Sep 2006 13:40:31 GMT]]></title><description><![CDATA[<p>kobauder schrieb:</p>
<blockquote>
<p>&quot;conversion from Tree to non-scalar&quot;</p>
</blockquote>
<p>Wo kommt denn der Fehler... wär vllt. nicht schlecht zu wissen, meinste nicht? :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144770</guid><dc:creator><![CDATA[bluecode]]></dc:creator><pubDate>Tue, 26 Sep 2006 13:40:31 GMT</pubDate></item><item><title><![CDATA[Reply to Klasse als rückgabetyp on Wed, 27 Sep 2006 05:17:45 GMT]]></title><description><![CDATA[<p>Z2 schrieb:</p>
<blockquote>
<p>Ja, dein Code ist ok. Vorausgesetzt Tree hat einen Copy-Konstruktor geht das so.</p>
<p>Edit: Sorry, hab die Zeile mit der Fehlermeldung übersehen. Vielleicht einmal ein Bißchen mehr Code zeigen, dann können wir dir auch helfen.</p>
</blockquote>
<p>Ich glaube nicht das ich einen copy-konstructor habe<br />
Wie macht man sowas?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1145199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1145199</guid><dc:creator><![CDATA[kobauder]]></dc:creator><pubDate>Wed, 27 Sep 2006 05:17:45 GMT</pubDate></item><item><title><![CDATA[Reply to Klasse als rückgabetyp on Wed, 27 Sep 2006 05:32:01 GMT]]></title><description><![CDATA[<p>Forensuche -&gt; Gibts schon mindestens 100x.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1145203</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1145203</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 27 Sep 2006 05:32:01 GMT</pubDate></item><item><title><![CDATA[Reply to Klasse als rückgabetyp on Wed, 27 Sep 2006 09:46:30 GMT]]></title><description><![CDATA[<p>ok, danke<br />
der fehler lag woanders <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1145281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1145281</guid><dc:creator><![CDATA[kobauder]]></dc:creator><pubDate>Wed, 27 Sep 2006 09:46:30 GMT</pubDate></item></channel></rss>