<?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 Typ nicht möglich ?]]></title><description><![CDATA[<p>hallo liebe coder,</p>
<p>ich habe hier ein problem...<br />
ich sage auch nicht viel dazu, denn der code spricht für sich....</p>
<p>ich will nur ein objekt gern übergeben bekommen...<br />
Hinzukommend jedoch bin ich nicht in der lage die elemente der<br />
struktur anzusprechen, obwohl die headers included sind...</p>
<p>vielen dank im voraus..</p>
<p><strong>CPoint3D.h:</strong></p>
<pre><code class="language-cpp">#pragma once

#include &lt;stdio.h&gt;
#include &quot;CPoint3DPolar.h&quot;

class CPoint3D
{
public:
	// Die Parameter
	struct MyPt
	{
		int		ValX	: 5; //5 Bit X ( 1.Koordinate )
		int		ValY	: 5; //5 Bit Y ( 2.Koordinate )
		int		ValZ	: 5; //5 Bit Z ( 3.Koordinate )
		int		ValI	: 8; //8 Bit I (   Intensität )
	};

	// Setzt Polarkoordinaten in cartesische um
	int Set( CPoint3DPolar &amp;ptPol )
	{
		return 1;
	};

};
</code></pre>
<p>------------------------------------------------------------------------</p>
<p><strong>CPoint3DPolar.h:</strong></p>
<p>#pragma once</p>
<p>#include &lt;stdio.h&gt;<br />
#include &quot;CPoint3D.h&quot;</p>
<pre><code class="language-cpp">class CPoint3DPolar
{
public:
	// Die Parameter
	struct MyPtPol
	{
		int		ValA	: 5; //5 Bit X ( Winkel: Alpha )
		int		Valß	: 5; //5 Bit Y ( Winkel: Beta  )
		int		ValS	: 5; //5 Bit Z ( Entfernung    )
		int		ValI	: 8; //8 Bit I ( Intensität    )
	};

	// Setzt cartesische Koordinaten in polare um
	int Set( CPoint3D &amp;pt )
	{
		return 1;
	};

};
</code></pre>
<p>-------------------------------------------------------------------------</p>
<p><strong>Fehlermeldung in CPoint3DPolar.h:</strong></p>
<p>d:\PROGRAMMIEREN\c++\_net_2003\CPoint3D\CPoint3DPolar.h(23):<br />
error C2061: Syntaxfehler: Bezeichner 'CPoint3D'</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/200170/klasse-als-typ-nicht-möglich</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 09:15:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200170.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Dec 2007 14:14:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:23:55 GMT]]></title><description><![CDATA[<p>hallo liebe coder,</p>
<p>ich habe hier ein problem...<br />
ich sage auch nicht viel dazu, denn der code spricht für sich....</p>
<p>ich will nur ein objekt gern übergeben bekommen...<br />
Hinzukommend jedoch bin ich nicht in der lage die elemente der<br />
struktur anzusprechen, obwohl die headers included sind...</p>
<p>vielen dank im voraus..</p>
<p><strong>CPoint3D.h:</strong></p>
<pre><code class="language-cpp">#pragma once

#include &lt;stdio.h&gt;
#include &quot;CPoint3DPolar.h&quot;

class CPoint3D
{
public:
	// Die Parameter
	struct MyPt
	{
		int		ValX	: 5; //5 Bit X ( 1.Koordinate )
		int		ValY	: 5; //5 Bit Y ( 2.Koordinate )
		int		ValZ	: 5; //5 Bit Z ( 3.Koordinate )
		int		ValI	: 8; //8 Bit I (   Intensität )
	};

	// Setzt Polarkoordinaten in cartesische um
	int Set( CPoint3DPolar &amp;ptPol )
	{
		return 1;
	};

};
</code></pre>
<p>------------------------------------------------------------------------</p>
<p><strong>CPoint3DPolar.h:</strong></p>
<p>#pragma once</p>
<p>#include &lt;stdio.h&gt;<br />
#include &quot;CPoint3D.h&quot;</p>
<pre><code class="language-cpp">class CPoint3DPolar
{
public:
	// Die Parameter
	struct MyPtPol
	{
		int		ValA	: 5; //5 Bit X ( Winkel: Alpha )
		int		Valß	: 5; //5 Bit Y ( Winkel: Beta  )
		int		ValS	: 5; //5 Bit Z ( Entfernung    )
		int		ValI	: 8; //8 Bit I ( Intensität    )
	};

	// Setzt cartesische Koordinaten in polare um
	int Set( CPoint3D &amp;pt )
	{
		return 1;
	};

};
</code></pre>
<p>-------------------------------------------------------------------------</p>
<p><strong>Fehlermeldung in CPoint3DPolar.h:</strong></p>
<p>d:\PROGRAMMIEREN\c++\_net_2003\CPoint3D\CPoint3DPolar.h(23):<br />
error C2061: Syntaxfehler: Bezeichner 'CPoint3D'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418778</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418778</guid><dc:creator><![CDATA[x-coder44]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:23:55 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:21:13 GMT]]></title><description><![CDATA[<p>Da brauchst du Forward-Deklarationen - und im Zweifelsfall mußt du sogar die Set()-Methoden aus den Headern auslagern.</p>
<p>PS: Der Name &quot;Valß&quot; geht wirklich durch den Compiler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418783</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:21:13 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:29:10 GMT]]></title><description><![CDATA[<p>kann ich nicht alles in einer headerdatei stehen lassen ?</p>
<p>und warum lassen sich meine elemente in der struktur im<br />
header selbst nicht ansprechen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418786</guid><dc:creator><![CDATA[x-coder44]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:29:10 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:33:14 GMT]]></title><description><![CDATA[<p>Wenn du die Elemente der jeweils anderen Struktur nutzen willst, mußt du vorher die komplette Definition angeben (dafür reicht die Forward-Deklaration nicht aus). Allerdings arbeitet der Compiler von oben nach unten - und wer immer als erstes im fertig zusammengebauten Quellfile steht, hat &quot;nur&quot; die Forward-Deklaration des Partners zur Verfügung.</p>
<p>x-coder44 schrieb:</p>
<blockquote>
<p>und warum lassen sich meine elemente in der struktur im<br />
header selbst nicht ansprechen ?</p>
</blockquote>
<p>Was meinst du jetzt damit? Die Elemente kannst du dort ansprechen, wo sie bekannt sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418790</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:33:14 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:39:36 GMT]]></title><description><![CDATA[<p>die elemente können jetzt angesprochen werden...<br />
war ein gedankenfehler von mir...</p>
<p>aber ein objekt kann ich immer noch nicht übergeben,<br />
und bei nem anderen programm hatte das auch damals geklappt....</p>
<p>die objekte sind doch durch die jeweiligen snderen header-files.h<br />
bekannt... ???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418795</guid><dc:creator><![CDATA[x-coder44]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:39:36 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:41:15 GMT]]></title><description><![CDATA[<p>Zeig doch mal den Code, wie du Objekte übergeben willst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418797</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418797</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:41:15 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:50:04 GMT]]></title><description><![CDATA[<p>das ist alles was ich hab....</p>
<p><strong>CPoint3DPolar.CPP:</strong></p>
<pre><code class="language-cpp">#pragma once

#include &lt;stdio.h&gt;
#include &quot;CPoint3DPolar.h&quot;

// Setzt cartesische Koordinaten in polare um
int CPoint3DPolar::Set( CPoint3D &amp;pt )
{
	return 1;
};
</code></pre>
<p>-------------------------------------------------------------------------------</p>
<p><strong>CPoint3DPolar.h:</strong></p>
<pre><code class="language-cpp">#pragma once

#include &lt;stdio.h&gt;
#include &quot;CPoint3D.h&quot;

class CPoint3DPolar
{
public:
	// Die Parameter
	struct MyPtPol
	{
		int		ValA	: 5; //5 Bit X ( Winkel: Alpha )
		int		Valß	: 5; //5 Bit Y ( Winkel: Beta  )
		int		ValS	: 5; //5 Bit Z ( Entfernung    )
		int		ValI	: 8; //8 Bit I ( Intensität    )
	};

	// Setzt cartesische Koordinaten in polare um
	int CPoint3DPolar::Set( CPoint3D &amp;pt ){}
};
</code></pre>
<p>-----------------------------------------------------------------------------</p>
<p><strong>CPoint3D.CPP:</strong></p>
<pre><code class="language-cpp">#pragma once

#include &lt;stdio.h&gt;
#include &quot;CPoint3D.h&quot;

// Setzt Polarkoordinaten in cartesische um
int CPoint3D::Set( CPoint3DPolar &amp;ptPol )
{
	return 1;
};
</code></pre>
<p>-----------------------------------------------------------------------------</p>
<p><strong>CPoint3D.h:</strong></p>
<pre><code class="language-cpp">class CPoint3D
{
public:
	// Die Parameter
	struct MyPt
	{
		int		ValX	: 5; //5 Bit X ( 1.Koordinate )
		int		ValY	: 5; //5 Bit Y ( 2.Koordinate )
		int		ValZ	: 5; //5 Bit Z ( 3.Koordinate )
		int		ValI	: 8; //8 Bit I (   Intensität )
	};

	// Setzt Polarkoordinaten in cartesische um
	int Set( CPoint3DPolar &amp;ptPol ){}
};
</code></pre>
<p>..............................................................................<br />
..............................................................................<br />
..............................................................................</p>
<p>ich will halt das objekt in der set-methode übergeben können,<br />
und eigentlich müsste ja auch beispielsweise die klasse &quot;CPoint3DPolar&quot; als typ anerkannt werden... oder nicht ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418808</guid><dc:creator><![CDATA[x-coder44]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 14:55:32 GMT]]></title><description><![CDATA[<p>Erstens wird dir da der Linker auf die Füße treten, wenn du die Methoden inline (leer) UND normal definierst - ersetze mal die {} durch ein Semikolon.</p>
<p>Zweitens benötigst du vermutlich noch ein Hauptprogramm, um etwas mit deinen Klassen machen zu können - und dort kannst du dann z.B. sowas schreiben:</p>
<pre><code class="language-cpp">CPoint3D kartesich;
CPoint3DPolar polar;
...
kartesich.Set(polar);
</code></pre>
<p>Drittens solltest du die Parameter als konstante Referenzen übergeben - außer die Set()-Methoden <strong>sollen</strong> die übergebenen Punkte verändern.</p>
<p>Und viertens kommt mir der Variablenname Val<strong>ß</strong> immer noch fragwürdig vor.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418813</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 11 Dec 2007 14:55:32 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 15:03:16 GMT]]></title><description><![CDATA[<p>habe alles verändert,<br />
jedoch beschwert er sich in den header-files weiterhin über die deklaration der jeweiligen typen (die ja die klassen sind...)</p>
<p>d:\PROGRAMMIEREN\c++\_net_2003\CPoint3D\CPoint3D.h(27): error C2061: Syntaxfehler: Bezeichner 'CPoint3DPolar'<br />
d:\PROGRAMMIEREN\c++\_net_2003\CPoint3D\CPoint3DPolar.h(27): error C2061: Syntaxfehler: Bezeichner 'CPoint3D'<br />
d:\PROGRAMMIEREN\c++\_net_2003\CPoint3D\CPoint3DPolar.h(27): error C2061: Syntaxfehler: Bezeichner 'CPoint3D'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418818</guid><dc:creator><![CDATA[x-coder44]]></dc:creator><pubDate>Tue, 11 Dec 2007 15:03:16 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 15:08:03 GMT]]></title><description><![CDATA[<p>Versuch's doch mal mit den erwähnten Forward-Deklarationen anstelle der wechselweisen Einbindung der Header. (in den CPP's mußt du dann jeweils beide Header einbinden)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418824</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418824</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 11 Dec 2007 15:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to klasse als Typ nicht möglich ? on Tue, 11 Dec 2007 15:36:15 GMT]]></title><description><![CDATA[<p>wie recht du hast...</p>
<p>danke für die foreward definition....</p>
<p>klappt wunderbar.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1418849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1418849</guid><dc:creator><![CDATA[x-coder44]]></dc:creator><pubDate>Tue, 11 Dec 2007 15:36:15 GMT</pubDate></item></channel></rss>