<?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[Fehlermeldung]]></title><description><![CDATA[<p>Hallo leute finde beim folgenden code meinen Fehler nicht:</p>
<p>Header:</p>
<pre><code>#ifndef CKOORDINATE_H_
#define CKOORDINATE_H_
#include &lt;string.h&gt;

class CKoordinate{
private:
	int m_x = 0;
	int m_y = 0;

public:

	CKoordinate(int x = 0, int y = 0);

	CKoordinate(CKoordinate&amp; origin);
	~CKoordinate();
	void print();
	bool move( int x, int y);
	bool minus(int x, int y);

	friend std::ostream&amp;  operator &lt;&lt;(std::ostream&amp; out,CKoordinate&amp; c);

};
std::ostream&amp;  operator &lt;&lt;(std::ostream&amp; out,CKoordinate&amp; c);

#endif /* CKOORDINATE_H_ */
</code></pre>
<p>cpp</p>
<pre><code>#include&lt;iostream&gt;
#include &quot;CKoordinate.h&quot;
using namespace std;

CKoordinate::CKoordinate(int x, int y){

	if( 0 &lt;= m_x &lt;= 100){

		m_x = x;

	}

		else

			cout &lt;&lt; &quot; error &quot; &lt;&lt; endl;

	m_x = 0;

	if( 0 &lt;= m_y &lt;= 100){

		m_y = y;

		}

	else

		cout &lt;&lt; &quot; error &quot; &lt;&lt; endl;

			m_y = 0;

}
</code></pre>
<p>Hier wird Fehler angezeigt im Header:<br />
int m_x = 0;<br />
int m_y = 0;</p>
<p>Description Resource Path Location Type<br />
ISO C++ forbids in-class initialization of non-const static member 'm_x' CKoordinate.h / line 14 C/C++ Problem<br />
ISO C++ forbids in-class initialization of non-const static member 'm_y' CKoordinate.h / line 15 C/C++ Problem<br />
ISO C++ forbids initialization of member 'm_x' [-fpermissive] CKoordinate.h / line 14 C/C++ Problem<br />
ISO C++ forbids initialization of member 'm_y' [-fpermissive] CKoordinate.h / line 15 C/C++ Problem<br />
making 'm_x' static [-fpermissive] CKoordinate.h / line 14 C/C++ Problem<br />
making 'm_y' static [-fpermissive] CKoordinate.h / line 15 C/C++ Problem</p>
<p>Könnt ihr mir helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/323885/fehlermeldung</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 10:51:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/323885.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Feb 2014 11:59:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 11:59:08 GMT]]></title><description><![CDATA[<p>Hallo leute finde beim folgenden code meinen Fehler nicht:</p>
<p>Header:</p>
<pre><code>#ifndef CKOORDINATE_H_
#define CKOORDINATE_H_
#include &lt;string.h&gt;

class CKoordinate{
private:
	int m_x = 0;
	int m_y = 0;

public:

	CKoordinate(int x = 0, int y = 0);

	CKoordinate(CKoordinate&amp; origin);
	~CKoordinate();
	void print();
	bool move( int x, int y);
	bool minus(int x, int y);

	friend std::ostream&amp;  operator &lt;&lt;(std::ostream&amp; out,CKoordinate&amp; c);

};
std::ostream&amp;  operator &lt;&lt;(std::ostream&amp; out,CKoordinate&amp; c);

#endif /* CKOORDINATE_H_ */
</code></pre>
<p>cpp</p>
<pre><code>#include&lt;iostream&gt;
#include &quot;CKoordinate.h&quot;
using namespace std;

CKoordinate::CKoordinate(int x, int y){

	if( 0 &lt;= m_x &lt;= 100){

		m_x = x;

	}

		else

			cout &lt;&lt; &quot; error &quot; &lt;&lt; endl;

	m_x = 0;

	if( 0 &lt;= m_y &lt;= 100){

		m_y = y;

		}

	else

		cout &lt;&lt; &quot; error &quot; &lt;&lt; endl;

			m_y = 0;

}
</code></pre>
<p>Hier wird Fehler angezeigt im Header:<br />
int m_x = 0;<br />
int m_y = 0;</p>
<p>Description Resource Path Location Type<br />
ISO C++ forbids in-class initialization of non-const static member 'm_x' CKoordinate.h / line 14 C/C++ Problem<br />
ISO C++ forbids in-class initialization of non-const static member 'm_y' CKoordinate.h / line 15 C/C++ Problem<br />
ISO C++ forbids initialization of member 'm_x' [-fpermissive] CKoordinate.h / line 14 C/C++ Problem<br />
ISO C++ forbids initialization of member 'm_y' [-fpermissive] CKoordinate.h / line 15 C/C++ Problem<br />
making 'm_x' static [-fpermissive] CKoordinate.h / line 14 C/C++ Problem<br />
making 'm_y' static [-fpermissive] CKoordinate.h / line 15 C/C++ Problem</p>
<p>Könnt ihr mir helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384382</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384382</guid><dc:creator><![CDATA[happy21]]></dc:creator><pubDate>Fri, 21 Feb 2014 11:59:08 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 12:07:23 GMT]]></title><description><![CDATA[<p>Initialisierung von Klassenmembern direkt in der Deklaration geht erst ab C++11.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384384</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Fri, 21 Feb 2014 12:07:23 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 12:07:56 GMT]]></title><description><![CDATA[<p>Dein Compiler unterstützt den C++11 Standard nicht. Die Fehlermeldungen sehen nach clang oder gcc aus, möglicherweise funktioniert --std=c++11.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384385</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Fri, 21 Feb 2014 12:07:56 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 12:39:07 GMT]]></title><description><![CDATA[<p>Ausserdem:</p>
<pre><code>#include &lt;string.h&gt;
</code></pre>
<p>Wozu? Du brauchst das nirgends. Ohnehin wäre <code>&lt;cstring&gt;</code> oder <code>&lt;string&gt;</code> angebrachter, da C++-Header.</p>
<pre><code>CKoordinate(CKoordinate&amp; origin); 
     ~CKoordinate();
</code></pre>
<p>Tu das weg. Wenn Regel der Grossen Drei, dann <a href="http://www.c-plusplus.net/forum/p2384365#2384365" rel="nofollow">richtig</a>. In dem Fall reicht aber der normale Konstruktor. Kopierkonstruktoren nehmen zudem eine Const-Referenz.</p>
<pre><code>CKoordinate
</code></pre>
<p>Das C ist unnötig, siehe <a href="http://www.c-plusplus.net/forum/p2005233#2005233" rel="nofollow">hier</a>.</p>
<p>Konsistente Einrückung und Klammernsetzung in der .cpp-Datei wäre auch nicht das Schlechteste...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384394</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384394</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Fri, 21 Feb 2014 12:39:07 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 13:32:00 GMT]]></title><description><![CDATA[<p>DIe struktur vom header muss ich leider so lassen ,da der Header so nach der Aufgabe aussehen soll.</p>
<p>Ich benutze eclipse , wisst ihr wie ich die Fehlermeldung weg bekomme ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384411</guid><dc:creator><![CDATA[happy21]]></dc:creator><pubDate>Fri, 21 Feb 2014 13:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 14:20:27 GMT]]></title><description><![CDATA[<p>Wer lesen kann ist klar in Vorteil.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384422</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Fri, 21 Feb 2014 14:20:27 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 21 Feb 2014 14:23:54 GMT]]></title><description><![CDATA[<p>Wenn du absolut gar nichts am Header verändern darfst, musst du einen anderen (C++11-fähigen) Compiler verwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2384425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2384425</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Fri, 21 Feb 2014 14:23:54 GMT</pubDate></item></channel></rss>