<?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[Rekursive Includes]]></title><description><![CDATA[<p>Hallo</p>
<p>ich nehme pro Klasse ein Paar .cpp/.h .<br />
Klasse A benötigt Attribute von Klasse B und Klasse B<br />
benütigt Attribute von Klasse A.</p>
<p>Wenn ich in klasse_a.h<br />
#include &quot;klasse_b.&quot;<br />
schreibe und in klasse_b.h<br />
#include &quot;klasse_a.h&quot;</p>
<p>(genauer schreibe ich natürlich:<br />
#if !defined KLASSE_B<br />
#include &quot;klasse_b.h&quot;<br />
#define KLASSE_B<br />
#endif<br />
)</p>
<p>dann setzt es eine Fehlermeldung wie &quot;Incluces zu tief geschachtelt&quot;.<br />
Das sehe ich auch ein. Aber wie *vermeidet* man solche zirkulären<br />
Includes am besten ? Vom Prinzip &quot;eine Klasse - ein Paar .cpp/.h&quot;<br />
will ich ungern abweichen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/152413/rekursive-includes</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 00:35:57 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/152413.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Jul 2006 07:57:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Rekursive Includes on Thu, 06 Jul 2006 07:57:55 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ich nehme pro Klasse ein Paar .cpp/.h .<br />
Klasse A benötigt Attribute von Klasse B und Klasse B<br />
benütigt Attribute von Klasse A.</p>
<p>Wenn ich in klasse_a.h<br />
#include &quot;klasse_b.&quot;<br />
schreibe und in klasse_b.h<br />
#include &quot;klasse_a.h&quot;</p>
<p>(genauer schreibe ich natürlich:<br />
#if !defined KLASSE_B<br />
#include &quot;klasse_b.h&quot;<br />
#define KLASSE_B<br />
#endif<br />
)</p>
<p>dann setzt es eine Fehlermeldung wie &quot;Incluces zu tief geschachtelt&quot;.<br />
Das sehe ich auch ein. Aber wie *vermeidet* man solche zirkulären<br />
Includes am besten ? Vom Prinzip &quot;eine Klasse - ein Paar .cpp/.h&quot;<br />
will ich ungern abweichen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092235</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092235</guid><dc:creator><![CDATA[Hobbyprogrammierer]]></dc:creator><pubDate>Thu, 06 Jul 2006 07:57:55 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursive Includes on Thu, 06 Jul 2006 08:07:50 GMT]]></title><description><![CDATA[<p>Normalerweise reicht für die Deklaration der jeweiligen Klassen eine Forward-Deklaration der anderen Member:</p>
<pre><code class="language-cpp">//A.H
class B;

class A
{
  ...
private:
  B* my_b;
  ...
};

//A.CPP
#include &quot;A.H&quot;
#include &quot;B.H&quot;
//Definition der A-Methoden
</code></pre>
<p>(das Dateipaar für B wird analog aufgebaut)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092242</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092242</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 06 Jul 2006 08:07:50 GMT</pubDate></item><item><title><![CDATA[Reply to Rekursive Includes on Thu, 06 Jul 2006 09:10:15 GMT]]></title><description><![CDATA[<p>Danke; werde es gleich ausprobieren.<br />
Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1092290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1092290</guid><dc:creator><![CDATA[Hobbyprogrammierer]]></dc:creator><pubDate>Thu, 06 Jul 2006 09:10:15 GMT</pubDate></item></channel></rss>