<?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[error 143]]></title><description><![CDATA[<p>hi hab ein fehler und weiß nicht wie ich den wegbekomme</p>
<p>hier meine statische klasse</p>
<pre><code>#pragma once
#ifndef ___CBASIC_H___
#define ___CBASIC_H___

#include &lt;iostream&gt;
#include &quot;cElement.h&quot;

#ifdef __cplusplus
extern &quot;C&quot; {
#endif

static class cBasic
{
public:
	static bool ExistMember(cElement * element);
	static bool FirstMember(void);
	static bool NextMember(cElement * element);
	static bool LastMember(cElement * element);

	static void CreateElement(cElement * _element);
	void DeleteMember(int index);

private:
	void FreeMember();
};

#ifdef __cplusplus
}
#endif

#endif
</code></pre>
<p>hier die funktion wo der fehler auftritt</p>
<pre><code>#pragma once
#ifndef ___COBJECT_H___
#define ___COBJECT_H___

#include &lt;iostream&gt;
#include &quot;cBasic.h&quot;
#include &quot;cPoint.h&quot;
#include &quot;cElement.h&quot;

#ifdef __cplusplus
extern &quot;C&quot; {
#endif

using namespace std;

class cObject
{
private:
	class cObjectElement : public cElement
	{
		public:
			string type;
			cPoint * point;
			bool allowdraw;
	};

	cObjectElement * element;

public:
	cObject(void);
	~cObject(void);

	void CreateObject(void)
{

	//Prueft ob es ueberhaupt ein objekt in der objectliste gibt
	if(this-&gt;element == NULL)
	{
		//Erstellt das erste Objekt und legt dieses als first object fest
		this-&gt;element = new cObjectElement();
		this-&gt;element-&gt;pre = NULL;
	}
	else
	{
		[b]cBasic.LastMember(this-&gt;element);[/b]
		//erstellt ein object und haengt es an das letzte object in der objectliste an.
		this-&gt;element-&gt;next = new cObjectElement();
		this-&gt;element-&gt;next-&gt;pre = this-&gt;element;
		[b]cBasic.NextMember(this-&gt;element);[/b]
	}
	this-&gt;element-&gt;next = NULL;
	this-&gt;element-&gt;point = NULL;
	this-&gt;element-&gt;allowdraw = true;
}
};

#ifdef __cplusplus
}
#endif

#endif
</code></pre>
<p>an den stellen die fett makiert sind bekomm ich immer den fehler:<br />
error C2143: Syntaxfehler: Es fehlt ';' vor '.'</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/299777/error-143</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 02:28:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/299777.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Feb 2012 09:53:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to error 143 on Sat, 18 Feb 2012 09:53:35 GMT]]></title><description><![CDATA[<p>hi hab ein fehler und weiß nicht wie ich den wegbekomme</p>
<p>hier meine statische klasse</p>
<pre><code>#pragma once
#ifndef ___CBASIC_H___
#define ___CBASIC_H___

#include &lt;iostream&gt;
#include &quot;cElement.h&quot;

#ifdef __cplusplus
extern &quot;C&quot; {
#endif

static class cBasic
{
public:
	static bool ExistMember(cElement * element);
	static bool FirstMember(void);
	static bool NextMember(cElement * element);
	static bool LastMember(cElement * element);

	static void CreateElement(cElement * _element);
	void DeleteMember(int index);

private:
	void FreeMember();
};

#ifdef __cplusplus
}
#endif

#endif
</code></pre>
<p>hier die funktion wo der fehler auftritt</p>
<pre><code>#pragma once
#ifndef ___COBJECT_H___
#define ___COBJECT_H___

#include &lt;iostream&gt;
#include &quot;cBasic.h&quot;
#include &quot;cPoint.h&quot;
#include &quot;cElement.h&quot;

#ifdef __cplusplus
extern &quot;C&quot; {
#endif

using namespace std;

class cObject
{
private:
	class cObjectElement : public cElement
	{
		public:
			string type;
			cPoint * point;
			bool allowdraw;
	};

	cObjectElement * element;

public:
	cObject(void);
	~cObject(void);

	void CreateObject(void)
{

	//Prueft ob es ueberhaupt ein objekt in der objectliste gibt
	if(this-&gt;element == NULL)
	{
		//Erstellt das erste Objekt und legt dieses als first object fest
		this-&gt;element = new cObjectElement();
		this-&gt;element-&gt;pre = NULL;
	}
	else
	{
		[b]cBasic.LastMember(this-&gt;element);[/b]
		//erstellt ein object und haengt es an das letzte object in der objectliste an.
		this-&gt;element-&gt;next = new cObjectElement();
		this-&gt;element-&gt;next-&gt;pre = this-&gt;element;
		[b]cBasic.NextMember(this-&gt;element);[/b]
	}
	this-&gt;element-&gt;next = NULL;
	this-&gt;element-&gt;point = NULL;
	this-&gt;element-&gt;allowdraw = true;
}
};

#ifdef __cplusplus
}
#endif

#endif
</code></pre>
<p>an den stellen die fett makiert sind bekomm ich immer den fehler:<br />
error C2143: Syntaxfehler: Es fehlt ';' vor '.'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2182609</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2182609</guid><dc:creator><![CDATA[Micha5000]]></dc:creator><pubDate>Sat, 18 Feb 2012 09:53:35 GMT</pubDate></item><item><title><![CDATA[Reply to error 143 on Sat, 18 Feb 2012 10:02:51 GMT]]></title><description><![CDATA[<p>Statische Methoden ruft man mit :: auf. (Zum Rest sag ich mal nichts.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2182613</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2182613</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Sat, 18 Feb 2012 10:02:51 GMT</pubDate></item><item><title><![CDATA[Reply to error 143 on Sat, 18 Feb 2012 11:10:28 GMT]]></title><description><![CDATA[<p>was soll das extern C da?<br />
was soll das pragma once vor dem include header? sorry, ich hab kein visual c++, bei mir gibts compile errors...<br />
was ist eine static class?</p>
<p>das sieht alles irgendwie komisch aus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2182633</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2182633</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sat, 18 Feb 2012 11:10:28 GMT</pubDate></item><item><title><![CDATA[Reply to error 143 on Sat, 18 Feb 2012 11:29:49 GMT]]></title><description><![CDATA[<p>Skym0sh0 schrieb:</p>
<blockquote>
<p>was ist eine static class?</p>
</blockquote>
<p>Das gibt es nicht, denn GCC 4.7 sagt:</p>
<blockquote>
<p>error: a storage class can only be specified for objects and functions|</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2182639</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2182639</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 18 Feb 2012 11:29:49 GMT</pubDate></item><item><title><![CDATA[Reply to error 143 on Sat, 18 Feb 2012 14:37:22 GMT]]></title><description><![CDATA[<p>Also du willst unbedingt static klassen benutzen und definierst den ctor der Klasse, aber implementierst ihn nicht? Dann mach ihn gleich private. Was soll der Code für dich machen? Mit extern C erklärst du dem Compiler, dass du den Code evtl aus C aufrufst und ihn deshalb in C compilieren soll. Der Compiler wird dir hier ein Auge zudrücken wegs den static methoden, aber eigentlich gibt's class in C nicht. Ist alles sehr komischer Code.</p>
<p>Ich würde static für Aufgaben wie Singleton Patterns benutzen, wo die static Methode zur Klasse gehört und deshalb darin implementiert werden kann, aber eine rein statische Klasse ist eher schlecht. Nimm lieber einen Namespace und der Aufruf bleibt komplett identisch! Class::staticMethod oder Namespace::Function.</p>
<p>Der Compiler sagt dir doch die Fehlerzeile, also darfst du uns die Zeile auch presentieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2182676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2182676</guid><dc:creator><![CDATA[PhilippHToner]]></dc:creator><pubDate>Sat, 18 Feb 2012 14:37:22 GMT</pubDate></item></channel></rss>