<?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[Ableiten von structs]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ist es eigentlich generell möglich, so wie bei klassen, structs abzuleiten? also z.b.</p>
<pre><code class="language-cpp">struct A
{
...
};

struct B : public A
{
...
}
</code></pre>
<p>danke,</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/134987/ableiten-von-structs</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 20:35:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/134987.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Jan 2006 08:05:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ableiten von structs on Mon, 30 Jan 2006 08:11:05 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ist es eigentlich generell möglich, so wie bei klassen, structs abzuleiten? also z.b.</p>
<pre><code class="language-cpp">struct A
{
...
};

struct B : public A
{
...
}
</code></pre>
<p>danke,</p>
]]></description><link>https://www.c-plusplus.net/forum/post/980702</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/980702</guid><dc:creator><![CDATA[pixsta]]></dc:creator><pubDate>Mon, 30 Jan 2006 08:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to Ableiten von structs on Mon, 30 Jan 2006 08:12:14 GMT]]></title><description><![CDATA[<p>---------</p>
]]></description><link>https://www.c-plusplus.net/forum/post/980705</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/980705</guid><dc:creator><![CDATA[pixsta]]></dc:creator><pubDate>Mon, 30 Jan 2006 08:12:14 GMT</pubDate></item><item><title><![CDATA[Reply to Ableiten von structs on Mon, 30 Jan 2006 08:12:15 GMT]]></title><description><![CDATA[<p>Mit C++ sollte das kein Problem sein.<br />
Du musst nur aufpassen, weil bei structs alles per<br />
default pulic ist.<br />
Aber üblicherweise nimmt man class dafür :-).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/980707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/980707</guid><dc:creator><![CDATA[Mr.Undertaker]]></dc:creator><pubDate>Mon, 30 Jan 2006 08:12:15 GMT</pubDate></item><item><title><![CDATA[Reply to Ableiten von structs on Mon, 30 Jan 2006 08:14:17 GMT]]></title><description><![CDATA[<p>ja, aber in diesem fall sind mir structs lieber ;).<br />
Wenn ich es so wie oben mache, dann geht folgendes nicht:</p>
<pre><code class="language-cpp">A a; //struct A
B b = (b)a; //casten von a nach b
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/980711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/980711</guid><dc:creator><![CDATA[pixsta]]></dc:creator><pubDate>Mon, 30 Jan 2006 08:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to Ableiten von structs on Mon, 30 Jan 2006 08:19:19 GMT]]></title><description><![CDATA[<p>Wenn dann so:</p>
<pre><code>B b = (B) a; //casten von a nach b
</code></pre>
<p>Geht das auch nicht ??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/980715</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/980715</guid><dc:creator><![CDATA[Mr.Undertaker]]></dc:creator><pubDate>Mon, 30 Jan 2006 08:19:19 GMT</pubDate></item><item><title><![CDATA[Reply to Ableiten von structs on Mon, 30 Jan 2006 12:52:54 GMT]]></title><description><![CDATA[<p>Mr.Undertaker schrieb:</p>
<blockquote>
<p>Wenn dann so:</p>
<pre><code>B b = (B) a; //casten von a nach b
</code></pre>
<p>Geht das auch nicht ??</p>
</blockquote>
<p>Geht auch nicht. A ist kein B. Umgekehrt würde es gehen</p>
<pre><code class="language-cpp">B b;
A a = b;
</code></pre>
<p>Aber das Ergebnis ist möglicherweise nicht was du erwartest. ( google slicing ).<br />
Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/980976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/980976</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Mon, 30 Jan 2006 12:52:54 GMT</pubDate></item></channel></rss>