<?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[[SOLVED] Vererbung und Casting]]></title><description><![CDATA[<p>Hallo,</p>
<p>meine Klassenhierarchie schaut so aus:</p>
<p>class A {}<br />
class B : public A {}<br />
class C : public B {}</p>
<p>Nun hab ich eine Methode a:<br />
a(A* foo);</p>
<p>Wenn ich nun a mit einer Instanz von C aufrufe, dann sagt der Compiler &quot;cannot convert C* to A*&quot;... Compiler ist gcc-4.1</p>
<p>Hat jmd. eine Idee, was ich da falsch mache?</p>
<p>danke im Voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/197736/solved-vererbung-und-casting</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 09:29:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/197736.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Nov 2007 09:58:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [SOLVED] Vererbung und Casting on Wed, 14 Nov 2007 10:13:51 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>meine Klassenhierarchie schaut so aus:</p>
<p>class A {}<br />
class B : public A {}<br />
class C : public B {}</p>
<p>Nun hab ich eine Methode a:<br />
a(A* foo);</p>
<p>Wenn ich nun a mit einer Instanz von C aufrufe, dann sagt der Compiler &quot;cannot convert C* to A*&quot;... Compiler ist gcc-4.1</p>
<p>Hat jmd. eine Idee, was ich da falsch mache?</p>
<p>danke im Voraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1402947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1402947</guid><dc:creator><![CDATA[hephaistos6]]></dc:creator><pubDate>Wed, 14 Nov 2007 10:13:51 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Vererbung und Casting on Wed, 14 Nov 2007 10:02:08 GMT]]></title><description><![CDATA[<p>Wie genau sieht denn der Aufruf aus? Und gibt der Compiler eventuell noch ZUsatzinformationen zu dem Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1402949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1402949</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 14 Nov 2007 10:02:08 GMT</pubDate></item><item><title><![CDATA[Reply to [SOLVED] Vererbung und Casting on Wed, 14 Nov 2007 10:13:37 GMT]]></title><description><![CDATA[<p>zu dämlich: hatte im File von a() vergessen das Header File von C zu includen...<br />
Manchmal versteh ich gcc nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>danke trotzdem!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1402958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1402958</guid><dc:creator><![CDATA[hephaistos6]]></dc:creator><pubDate>Wed, 14 Nov 2007 10:13:37 GMT</pubDate></item></channel></rss>