<?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[Programm läuft nicht]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich versuche mich gerade bei der Programmierung mit C++.</p>
<p>Zu diesem Zweck, habe ich ein Bsp. Programm aus einem Buch abgeschrieben. Nur leider läuft es nicht.</p>
<p>Ich habe leider keine Ahnung warum.<br />
Ich bekomme immer wieder folgende Fehlermeldungen:</p>
<pre><code>c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(12) : error C2065: 'cout' : nichtdeklarierter Bezeichner
c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(12) : error C2296: '&lt;&lt;' : Ungültig, da der linke Operand vom Typ ''unknown-type'' ist
c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(12) : error C2297: '&lt;&lt;' : Ungültig, da der rechte Operand vom Typ 'char [14]' ist
c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(13) : error C2065: 'cin' : nichtdeklarierter Bezeichner
</code></pre>
<p>(nur ein Auszug)</p>
<p>Ich dachte diese Dinge sind in der &quot;iostream.h&quot; deklariert. <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>Hier der Bsp.Code:</p>
<p>FZliste.h</p>
<pre><code class="language-cpp">#ifndef _FZLISTE
#define _FZLISTE

class CFZbase							
{
protected:
	char m_Kennzeichen[10];
	int m_Erstzulassung;

public:
	CFZbase(char *k, int j);
	CFZbase();
	virtual void Print();
	virtual CFZbase *Copy()=0;
	char *Kennzeichen() {return m_Kennzeichen;}

};

class CPKW : public CFZbase
{
	int m_hubraum;
	int m_leistung;
	short m_schadstofftyp;

public:
	CPKW(char *Knz, int j, int h, int l, short s=0):CFZbase(Knz, j), m_hubraum(h), m_leistung(l), m_schadstofftyp(s) {};
	CPKW();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CMotorrad : public CFZbase 
{
	int m_hubraum;
public:
	CMotorrad(char *Kennz, int jahr, int h): CFZbase(Kennz, jahr) , m_hubraum(h) {};
	CMotorrad();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CLKW : public CFZbase 
{
	int m_AnzAchsen, m_Zuladung;
public:
	CLKW(char *Kennz, int jahr, int A, int Z): CFZbase(Kennz, jahr) , m_AnzAchsen(A), m_Zuladung(Z) {};
	CLKW();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CNode
{
	CFZbase *m_object;
	CNode *m_left, *m_right;
	int cmpNode(CNode *);

public:
	CNode(CFZbase *obj) {m_object = obj-&gt;Copy();
	m_left = m_right = NULL;}
	void Print();
	CFZbase *Suchen(char *Kennzeichen);
	CNode *AddObject(CFZbase *obj);
};

#endif
</code></pre>
<p>FZliste.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;FZliste.h&quot;		

inline CFZbase::CFZbase (char *k, int j)
{
strcpy(m_Kennzeichen, k);
m_Erstzulassung = j;
}

CFZbase::CFZbase()
{
	cout &lt;&lt; &quot;Kennzeichen: &quot;;
	cin &gt;&gt; m_Kennzeichen;
	cout &lt;&lt; &quot;Jahr der Erstzulassung: &quot;;
	cin &gt;&gt; m_Erstzulassung;
}

void CFZbase::Print()
{
cout &lt;&lt; endl &lt;&lt; m_Kennzeichen &lt;&lt; endl;
cout &lt;&lt; &quot;Erstzulassung:\t\t&quot; &lt;&lt; m_Erstzulassung &lt;&lt; endl;
}

CPKW::CPKW()
{
	cout &lt;&lt; &quot;Hubraum:\t\t&quot;;
	cin &gt;&gt; m_hubraum;
	cout &lt;&lt; &quot;Leistung:\t\t&quot;;
	cin &gt;&gt; m_leistung;
	cout &lt;&lt; &quot;Schadstoffklasse: [0..2]\t&quot;;
	cin &gt;&gt; m_schadstofftyp;
}

void CPKW::Print()
{
	static char *Klassen[3] = {&quot;Sauber&quot;, &quot;Dreckschleuder&quot;, &quot;Diesel&quot;};
	CFZbase:: Print();

	cout &lt;&lt; &quot;Typ: \t\t\tPKW\n&quot;;
	cout &lt;&lt; &quot;Hubraum:\t\t&quot; &lt;&lt; m_hubraum &lt;&lt; endl;
	cout &lt;&lt; &quot;Leistung:\t\t&quot; &lt;&lt; m_leistung &lt;&lt; endl;
	cout &lt;&lt; &quot;Schadstoffklasse:\t\t&quot; &lt;&lt; Klassen[m_schadstofftyp] &lt;&lt; endl;
}

CFZbase* CPKW::Copy()
{
return new CPKW(*this);
}

CMotorrad::CMotorrad()
{
	cout &lt;&lt; &quot;Hubraum:\t\t&quot;;
	cin &gt;&gt; m_hubraum;
}

void CMotorrad::Print()
{
	CFZbase::Print();
	cout &lt;&lt; &quot;Typ:\t\t\tMotorrad\n&quot;;
	cout &lt;&lt; &quot;Hubraum:\t\t&quot; &lt;&lt; m_hubraum &lt;&lt; endl;
}

CFZbase* CMotorrad::Copy()
{
return new CMotorrad(*this);
}

CLKW::CLKW()
{
	cout &lt;&lt; &quot;Anzahl Achsen:\t\t&quot;;
	cin &gt;&gt; m_AnzAchsen;
	cout &lt;&lt; &quot;max Zuladung:\t\t&quot;;
	cin &gt;&gt; m_Zuladung;
}

void CLKW::Print()
{
	CFZbase::Print();
	cout &lt;&lt; &quot;Typ:\t\t\tLKW\n&quot;;
	cout &lt;&lt; &quot;Anzahl Achsen:\t\t&quot; &lt;&lt; m_AnzAchsen &lt;&lt; endl;
	cout &lt;&lt; &quot;max. Zuladung:\t\t&quot; &lt;&lt; m_Zuladung &lt;&lt; endl;
}

CFZbase* CLKW::Copy()
{
return new CLKW(*this);
}

inline int CNode::CmpNode(CNode *node2)
{
return strcmp(m_object-&gt;Kennzeichen(),node2-&gt;m_object-&gt;Kennzeichen());
}

CNode *CNode::AddObject(CFZbase *obj)
{
CNode *root = this;
int inserted = 0;
CNode *newnode = new CNode(obj);

if (root == NULL)
	return newnode;
do {
	if (root-&gt;CmpNode(newnode) &gt; 0) {
		if (root-&gt;m_left == Null) {
			root-&gt;m_left = newnode;
			inserted = 1;
		}
		else
			root = root-&gt;m_left;
	}
	else {
		if (root-&gt;m_right == Null) {
			root-&gt;m_right = newnode;
			inserted = 1;
		}
		else
			root = root-&gt;m_right;
	}
	}while (inserted == 0);
	return this;
}

CFZbase *CNode::Suchen(char *Kennz)
{
	int suchstatus = 1;
	CNode *Start = this;

	while (Start != NULL &amp;&amp; suchstatus != 0){
		suchstatus = strcmp(Kennz, Start-&gt;m_object-&gt;Kennzeichen());
		if (suchstatus != 0) {
			if (suchstatus &lt; 0)
				Start = Start-&gt;m_left;
			else
				Start = Start-&gt;m_right;
		}
	}
	if (suchstatus != 0)
		return Null;
	else
		return Start-&gt;m_object;
}

void CNode::Print()
{
	if (m_left != NULL)
		m_left-&gt;Print();
	m_object-&gt;Print();
	if (m_right != 0)
		m_right-&gt;Print();
}
</code></pre>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;	

#include &quot;FZliste.h&quot;			

main()								
{
	char Cmd;
	CNode *root = NULL;

	do {
		cout &lt;&lt; &quot;Cmd: &quot;; 
		cin &gt;&gt; Cmd;
		switch (Cmd) {
		case 'p':
			root = root-&gt;AddObject(new CPKW);
			break;
		case 'm':
			root = root-&gt;AddObject(new CMotorrad);
			break;
		case 'l':
			root = root-&gt;AddObject(new CLKW);
			break;
		case 's':
			char kennz[10];
			CFZbase *FZ;
			cin &gt;&gt; kennz;
			FZ = root-&gt;Suchen(kennz);
			if (FZ != NULL)
				FZ-&gt;Print();
			break;
		case 'd':
			root-&gt;Print();
			break;
		}
	} while (Cmd != 'x');
}
</code></pre>
<p>Kann mir jemand weiterhelfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/217326/programm-läuft-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sat, 10 Oct 2026 15:53:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/217326.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Jul 2008 13:19:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programm läuft nicht on Sun, 06 Jul 2008 13:19:32 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich versuche mich gerade bei der Programmierung mit C++.</p>
<p>Zu diesem Zweck, habe ich ein Bsp. Programm aus einem Buch abgeschrieben. Nur leider läuft es nicht.</p>
<p>Ich habe leider keine Ahnung warum.<br />
Ich bekomme immer wieder folgende Fehlermeldungen:</p>
<pre><code>c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(12) : error C2065: 'cout' : nichtdeklarierter Bezeichner
c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(12) : error C2296: '&lt;&lt;' : Ungültig, da der linke Operand vom Typ ''unknown-type'' ist
c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(12) : error C2297: '&lt;&lt;' : Ungültig, da der rechte Operand vom Typ 'char [14]' ist
c:\Dokumente und Einstellungen\Desktop\Bsp.FZliste\FZliste.cpp(13) : error C2065: 'cin' : nichtdeklarierter Bezeichner
</code></pre>
<p>(nur ein Auszug)</p>
<p>Ich dachte diese Dinge sind in der &quot;iostream.h&quot; deklariert. <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>Hier der Bsp.Code:</p>
<p>FZliste.h</p>
<pre><code class="language-cpp">#ifndef _FZLISTE
#define _FZLISTE

class CFZbase							
{
protected:
	char m_Kennzeichen[10];
	int m_Erstzulassung;

public:
	CFZbase(char *k, int j);
	CFZbase();
	virtual void Print();
	virtual CFZbase *Copy()=0;
	char *Kennzeichen() {return m_Kennzeichen;}

};

class CPKW : public CFZbase
{
	int m_hubraum;
	int m_leistung;
	short m_schadstofftyp;

public:
	CPKW(char *Knz, int j, int h, int l, short s=0):CFZbase(Knz, j), m_hubraum(h), m_leistung(l), m_schadstofftyp(s) {};
	CPKW();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CMotorrad : public CFZbase 
{
	int m_hubraum;
public:
	CMotorrad(char *Kennz, int jahr, int h): CFZbase(Kennz, jahr) , m_hubraum(h) {};
	CMotorrad();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CLKW : public CFZbase 
{
	int m_AnzAchsen, m_Zuladung;
public:
	CLKW(char *Kennz, int jahr, int A, int Z): CFZbase(Kennz, jahr) , m_AnzAchsen(A), m_Zuladung(Z) {};
	CLKW();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CNode
{
	CFZbase *m_object;
	CNode *m_left, *m_right;
	int cmpNode(CNode *);

public:
	CNode(CFZbase *obj) {m_object = obj-&gt;Copy();
	m_left = m_right = NULL;}
	void Print();
	CFZbase *Suchen(char *Kennzeichen);
	CNode *AddObject(CFZbase *obj);
};

#endif
</code></pre>
<p>FZliste.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;FZliste.h&quot;		

inline CFZbase::CFZbase (char *k, int j)
{
strcpy(m_Kennzeichen, k);
m_Erstzulassung = j;
}

CFZbase::CFZbase()
{
	cout &lt;&lt; &quot;Kennzeichen: &quot;;
	cin &gt;&gt; m_Kennzeichen;
	cout &lt;&lt; &quot;Jahr der Erstzulassung: &quot;;
	cin &gt;&gt; m_Erstzulassung;
}

void CFZbase::Print()
{
cout &lt;&lt; endl &lt;&lt; m_Kennzeichen &lt;&lt; endl;
cout &lt;&lt; &quot;Erstzulassung:\t\t&quot; &lt;&lt; m_Erstzulassung &lt;&lt; endl;
}

CPKW::CPKW()
{
	cout &lt;&lt; &quot;Hubraum:\t\t&quot;;
	cin &gt;&gt; m_hubraum;
	cout &lt;&lt; &quot;Leistung:\t\t&quot;;
	cin &gt;&gt; m_leistung;
	cout &lt;&lt; &quot;Schadstoffklasse: [0..2]\t&quot;;
	cin &gt;&gt; m_schadstofftyp;
}

void CPKW::Print()
{
	static char *Klassen[3] = {&quot;Sauber&quot;, &quot;Dreckschleuder&quot;, &quot;Diesel&quot;};
	CFZbase:: Print();

	cout &lt;&lt; &quot;Typ: \t\t\tPKW\n&quot;;
	cout &lt;&lt; &quot;Hubraum:\t\t&quot; &lt;&lt; m_hubraum &lt;&lt; endl;
	cout &lt;&lt; &quot;Leistung:\t\t&quot; &lt;&lt; m_leistung &lt;&lt; endl;
	cout &lt;&lt; &quot;Schadstoffklasse:\t\t&quot; &lt;&lt; Klassen[m_schadstofftyp] &lt;&lt; endl;
}

CFZbase* CPKW::Copy()
{
return new CPKW(*this);
}

CMotorrad::CMotorrad()
{
	cout &lt;&lt; &quot;Hubraum:\t\t&quot;;
	cin &gt;&gt; m_hubraum;
}

void CMotorrad::Print()
{
	CFZbase::Print();
	cout &lt;&lt; &quot;Typ:\t\t\tMotorrad\n&quot;;
	cout &lt;&lt; &quot;Hubraum:\t\t&quot; &lt;&lt; m_hubraum &lt;&lt; endl;
}

CFZbase* CMotorrad::Copy()
{
return new CMotorrad(*this);
}

CLKW::CLKW()
{
	cout &lt;&lt; &quot;Anzahl Achsen:\t\t&quot;;
	cin &gt;&gt; m_AnzAchsen;
	cout &lt;&lt; &quot;max Zuladung:\t\t&quot;;
	cin &gt;&gt; m_Zuladung;
}

void CLKW::Print()
{
	CFZbase::Print();
	cout &lt;&lt; &quot;Typ:\t\t\tLKW\n&quot;;
	cout &lt;&lt; &quot;Anzahl Achsen:\t\t&quot; &lt;&lt; m_AnzAchsen &lt;&lt; endl;
	cout &lt;&lt; &quot;max. Zuladung:\t\t&quot; &lt;&lt; m_Zuladung &lt;&lt; endl;
}

CFZbase* CLKW::Copy()
{
return new CLKW(*this);
}

inline int CNode::CmpNode(CNode *node2)
{
return strcmp(m_object-&gt;Kennzeichen(),node2-&gt;m_object-&gt;Kennzeichen());
}

CNode *CNode::AddObject(CFZbase *obj)
{
CNode *root = this;
int inserted = 0;
CNode *newnode = new CNode(obj);

if (root == NULL)
	return newnode;
do {
	if (root-&gt;CmpNode(newnode) &gt; 0) {
		if (root-&gt;m_left == Null) {
			root-&gt;m_left = newnode;
			inserted = 1;
		}
		else
			root = root-&gt;m_left;
	}
	else {
		if (root-&gt;m_right == Null) {
			root-&gt;m_right = newnode;
			inserted = 1;
		}
		else
			root = root-&gt;m_right;
	}
	}while (inserted == 0);
	return this;
}

CFZbase *CNode::Suchen(char *Kennz)
{
	int suchstatus = 1;
	CNode *Start = this;

	while (Start != NULL &amp;&amp; suchstatus != 0){
		suchstatus = strcmp(Kennz, Start-&gt;m_object-&gt;Kennzeichen());
		if (suchstatus != 0) {
			if (suchstatus &lt; 0)
				Start = Start-&gt;m_left;
			else
				Start = Start-&gt;m_right;
		}
	}
	if (suchstatus != 0)
		return Null;
	else
		return Start-&gt;m_object;
}

void CNode::Print()
{
	if (m_left != NULL)
		m_left-&gt;Print();
	m_object-&gt;Print();
	if (m_right != 0)
		m_right-&gt;Print();
}
</code></pre>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;	

#include &quot;FZliste.h&quot;			

main()								
{
	char Cmd;
	CNode *root = NULL;

	do {
		cout &lt;&lt; &quot;Cmd: &quot;; 
		cin &gt;&gt; Cmd;
		switch (Cmd) {
		case 'p':
			root = root-&gt;AddObject(new CPKW);
			break;
		case 'm':
			root = root-&gt;AddObject(new CMotorrad);
			break;
		case 'l':
			root = root-&gt;AddObject(new CLKW);
			break;
		case 's':
			char kennz[10];
			CFZbase *FZ;
			cin &gt;&gt; kennz;
			FZ = root-&gt;Suchen(kennz);
			if (FZ != NULL)
				FZ-&gt;Print();
			break;
		case 'd':
			root-&gt;Print();
			break;
		}
	} while (Cmd != 'x');
}
</code></pre>
<p>Kann mir jemand weiterhelfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1541877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1541877</guid><dc:creator><![CDATA[Neuling2008]]></dc:creator><pubDate>Sun, 06 Jul 2008 13:19:32 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Sun, 06 Jul 2008 13:21:05 GMT]]></title><description><![CDATA[<p>Nach den Headern</p>
<pre><code class="language-cpp">using namespace std;
</code></pre>
<p>schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1541879</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1541879</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 06 Jul 2008 13:21:05 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Sun, 06 Jul 2008 14:32:10 GMT]]></title><description><![CDATA[<p>Erst mal:<br />
Ich bezweifle, dass dir das was bringt, das abzuschreiben, wenn du nich ma die einfachsten Fehlermeldungen verstehst&gt;&lt;</p>
<p>Neuling2008 schrieb:</p>
<blockquote>
<p>FZliste.h</p>
<pre><code class="language-cpp">#ifndef _FZLISTE
#define _FZLISTE
//so was tut man nicht... _X ist immer für den Compiler reserviert... also schreib halt FZLISTE_INCLUDE oder so...

class CFZbase						
{
protected:
	char m_Kennzeichen[10];
	int m_Erstzulassung;

public:
	CFZbase(char *k, int j);
	CFZbase();
	virtual void Print();
	virtual CFZbase *Copy()=0;
	char *Kennzeichen() {return m_Kennzeichen;} //keine const funktion?
};

class CPKW : public CFZbase
{
	int m_hubraum;
	int m_leistung;
	short m_schadstofftyp;

public:
	CPKW(char *Knz, int j, int h, int l, short s=0):CFZbase(Knz, j), m_hubraum(h), m_leistung(l), m_schadstofftyp(s) {};
	CPKW();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CMotorrad : public CFZbase 
{
	int m_hubraum;
public:
	CMotorrad(char *Kennz, int jahr, int h): CFZbase(Kennz, jahr) , m_hubraum(h) {};
	CMotorrad();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CLKW : public CFZbase 
{
	int m_AnzAchsen, m_Zuladung;
public:
	CLKW(char *Kennz, int jahr, int A, int Z): CFZbase(Kennz, jahr) , m_AnzAchsen(A), m_Zuladung(Z) {};
	CLKW();
	virtual void Print();
	virtual CFZbase *Copy();
};

class CNode
{
	CFZbase *m_object;
	CNode *m_left, *m_right;
	int cmpNode(CNode *);
public:
	CNode(CFZbase *obj) {m_object = obj-&gt;Copy();
	m_left = m_right = NULL;}
	void Print(); //sollte auch ne const funktion sein!!!
	CFZbase *Suchen (char *Kennzeichen); //const...
	CNode *AddObject(CFZbase *obj);
};

#endif
</code></pre>
<p>FZliste.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &quot;FZliste.h&quot;

using namespace std;
//oder
using std::cout, std::cin, std::endl;
//oder einfach statt cout immer std::cout schreiben etc
		
inline CFZbase::CFZbase (char *k, int j) //einen ctor inline machen? Oo
{
strcpy (m_Kennzeichen, k); //strcpy_s !
m_Erstzulassung = j; //so was gehört eigtl in die Initialisierungsliste
}

CFZbase::CFZbase()
{
	std::cout &lt;&lt; &quot;Kennzeichen: &quot;;
	std::cin &gt;&gt; m_Kennzeichen;
	std::cout &lt;&lt; &quot;Jahr der Erstzulassung: &quot;;
	std::cin &gt;&gt; m_Erstzulassung;
}

void CFZbase::Print()
{
std::cout &lt;&lt; &quot;\r\n&quot; &lt;&lt; m_Kennzeichen
  &lt;&lt; &quot;Erstzulassung:\t\t&quot; &lt;&lt; m_Erstzulassung &lt;&lt; std::endl;
}

CPKW::CPKW()
{
	std::cout &lt;&lt; &quot;Hubraum:\t\t&quot;;
	std::cin &gt;&gt; m_hubraum;
	std::cout &lt;&lt; &quot;Leistung:\t\t&quot;;
	std::cin &gt;&gt; m_leistung;
	std::cout &lt;&lt; &quot;Schadstoffklasse: [0..2]\t&quot;;
	std::cin &gt;&gt; m_schadstofftyp;
}

void CPKW::Print()
{
	static char *Klassen[3] = {&quot;Sauber&quot;, &quot;Dreckschleuder&quot;, &quot;Diesel&quot;};
	CFZbase:: Print();

	cout &lt;&lt; &quot;Typ: \t\t\tPKW\n&quot;;
	cout &lt;&lt; &quot;Hubraum:\t\t&quot; &lt;&lt; m_hubraum &lt;&lt; endl;
	cout &lt;&lt; &quot;Leistung:\t\t&quot; &lt;&lt; m_leistung &lt;&lt; endl;
	cout &lt;&lt; &quot;Schadstoffklasse:\t\t&quot; &lt;&lt; Klassen[m_schadstofftyp] &lt;&lt; endl;
}

CFZbase* CPKW::Copy()
{
return new CPKW(*this);
}

CMotorrad::CMotorrad()
{
	cout &lt;&lt; &quot;Hubraum:\t\t&quot;;
	cin &gt;&gt; m_hubraum;
}

void CMotorrad::Print()
{
	CFZbase::Print();
	cout &lt;&lt; &quot;Typ:\t\t\tMotorrad\n&quot;;
	cout &lt;&lt; &quot;Hubraum:\t\t&quot; &lt;&lt; m_hubraum &lt;&lt; endl;
}

CFZbase* CMotorrad::Copy()
{
return new CMotorrad(*this);
}

CLKW::CLKW()
{
	cout &lt;&lt; &quot;Anzahl Achsen:\t\t&quot;;
	cin &gt;&gt; m_AnzAchsen;
	cout &lt;&lt; &quot;max Zuladung:\t\t&quot;;
	cin &gt;&gt; m_Zuladung;
}

void CLKW::Print()
{
	CFZbase::Print();
	cout &lt;&lt; &quot;Typ:\t\t\tLKW\n&quot;;
	cout &lt;&lt; &quot;Anzahl Achsen:\t\t&quot; &lt;&lt; m_AnzAchsen &lt;&lt; endl;
	cout &lt;&lt; &quot;max. Zuladung:\t\t&quot; &lt;&lt; m_Zuladung &lt;&lt; endl;
}

CFZbase* CLKW::Copy()
{
return new CLKW(*this);
}

inline int CNode::CmpNode(CNode *node2)
{
return strcmp(m_object-&gt;Kennzeichen(),node2-&gt;m_object-&gt;Kennzeichen());
}

CNode *CNode::AddObject(CFZbase *obj)
{
CNode *root = this;
int inserted = 0;
CNode *newnode = new CNode(obj);

if (root == NULL)
	return newnode;
do {
	if (root-&gt;CmpNode(newnode) &gt; 0) {
		if (root-&gt;m_left == Null) {
			root-&gt;m_left = newnode;
			inserted = 1;
		}
		else
			root = root-&gt;m_left;
	}
	else {
		if (root-&gt;m_right == Null) {
			root-&gt;m_right = newnode;
			inserted = 1;
		}
		else
			root = root-&gt;m_right;
	}
	}while (inserted == 0);
	return this;
}

CFZbase *CNode::Suchen(char *Kennz)
{
	int suchstatus = 1;
	CNode *Start = this;

	while (Start != NULL &amp;&amp; suchstatus != 0){
		suchstatus = strcmp(Kennz, Start-&gt;m_object-&gt;Kennzeichen());
		if (suchstatus != 0) {
			if (suchstatus &lt; 0)
				Start = Start-&gt;m_left;
			else
				Start = Start-&gt;m_right;
		}
	}
	if (suchstatus != 0)
		return Null;
	else
		return Start-&gt;m_object;
}

void CNode::Print()
{
	if (m_left != NULL)
		m_left-&gt;Print();
	m_object-&gt;Print();
	if (m_right != 0)
		m_right-&gt;Print();
}
</code></pre>
<p>main.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;	

#include &quot;FZliste.h&quot;			

main()								
{
	char Cmd;
	CNode *root = NULL;

	do {
		cout &lt;&lt; &quot;Cmd: &quot;; 
		cin &gt;&gt; Cmd;
		switch (Cmd) {
		case 'p':
			root = root-&gt;AddObject(new CPKW);
			break;
		case 'm':
			root = root-&gt;AddObject(new CMotorrad);
			break;
		case 'l':
			root = root-&gt;AddObject(new CLKW);
			break;
		case 's':
			char kennz[10];
			CFZbase *FZ;
			cin &gt;&gt; kennz;
			FZ = root-&gt;Suchen(kennz);
			if (FZ != NULL)
				FZ-&gt;Print();
			break;
		case 'd':
			root-&gt;Print();
			break;
		}
	} while (Cmd != 'x');
}
</code></pre>
</blockquote>
<p>Und die Copy-Funktionen würde ich als inline definieren...</p>
<p>Verstehst du das, was du dort abgeschrieben hast oder nicht?</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1541908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1541908</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sun, 06 Jul 2008 14:32:10 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Mon, 07 Jul 2008 14:32:33 GMT]]></title><description><![CDATA[<p>Neuling2008 schrieb:</p>
<blockquote>
<p>Ich dachte diese Dinge sind in der &quot;iostream.h&quot; deklariert. <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>
</blockquote>
<p>Nexus schrieb:</p>
<blockquote>
<p>Nach den Headern <code>using namespace std;</code> schreiben.</p>
</blockquote>
<p>Nein, sich mit dem Standard und Namespaces auseinandersetzen...</p>
<p>cheers, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1541910</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1541910</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 07 Jul 2008 14:32:33 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Sun, 06 Jul 2008 14:53:06 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>unskilled schrieb:</p>
<blockquote>
<p>Ich dachte diese Dinge sind in der &quot;iostream.h&quot; deklariert. <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>
</blockquote>
<p>Nexus schrieb:</p>
<blockquote>
<p>Nach den Headern <code>using namespace std;</code> schreiben.</p>
</blockquote>
<p>Nein, sich mit dem Standard und Namespaces auseinandersetzen...</p>
<p>cheers, Swordfish</p>
</blockquote>
<p>1. falsch gequotet - das war nicht ich, der das gefragt / gesagt hat...<br />
2. seh ich aber genau so...</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1541920</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1541920</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Sun, 06 Jul 2008 14:53:06 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Mon, 07 Jul 2008 14:45:47 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>1. falsch gequotet - das war nicht ich, der das gefragt / gesagt hat...</p>
</blockquote>
<p>Sorry. Korrigiert.</p>
<p>cheers, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1542793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1542793</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Mon, 07 Jul 2008 14:45:47 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Mon, 07 Jul 2008 15:11:18 GMT]]></title><description><![CDATA[<p>Ach ja, und ein passender Titel wäre nächstes Mal auch angebracht. Dass ein Programm nicht läuft, ist sehr oft der Fall <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1542831</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1542831</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Mon, 07 Jul 2008 15:11:18 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Mon, 07 Jul 2008 18:25:49 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">CFZbase *Suchen(char *Kennzeichen); //const...
</code></pre>
</blockquote>
<p>Aufpassen!<br />
Entweder 2x const:</p>
<pre><code class="language-cpp">CFZbase const* Suchen(char* Kennzeichen) const;
</code></pre>
<p>oder garkein const. Oder beide Varianten (const overload).<br />
Aber auf keinen Fall</p>
<pre><code class="language-cpp">CFZbase* Suchen(char* Kennzeichen) const;
</code></pre>
<p>Zumindest nicht so ohne weiteres, also ohne sich zu überlegen was die Folgen wären.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1542947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1542947</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 07 Jul 2008 18:25:49 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Tue, 08 Jul 2008 10:20:47 GMT]]></title><description><![CDATA[<p>Danke - daran hatte ich gar ne gedacht &gt;&lt;</p>
<p>bb</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543263</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Tue, 08 Jul 2008 10:20:47 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Tue, 08 Jul 2008 10:27:51 GMT]]></title><description><![CDATA[<p>Bin ich blind oder ist das Verhältnis von new zu delete etwas deutlich zu groß?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543270</guid><dc:creator><![CDATA[templäd]]></dc:creator><pubDate>Tue, 08 Jul 2008 10:27:51 GMT</pubDate></item><item><title><![CDATA[Reply to Programm läuft nicht on Tue, 08 Jul 2008 10:33:34 GMT]]></title><description><![CDATA[<p>Wenn du einen Doppelklick auf die Fehlermeldung machst, dann springt der &quot;Compiler&quot; in Zeile. Vielleicht hilft dir das, die Fehler in Zukunft besser zu interpretieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1543273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1543273</guid><dc:creator><![CDATA[Swordfish_FAN]]></dc:creator><pubDate>Tue, 08 Jul 2008 10:33:34 GMT</pubDate></item></channel></rss>