<?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[Not a Type]]></title><description><![CDATA[<p>hallo ich habe folgenden Code, bei dem diese fehlermeldungen kommen:</p>
<blockquote>
<p>||=== TicTacToe, Debug ===|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Field.hpp|18|error: 'Player' has not been declared|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|12|error: 'Player' does not name a type|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|13|error: 'Player' does not name a type|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|14|error: 'Player' does not name a type|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|16|error: expected ')' before '&amp;' token|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|19|error: 'Player' has not been declared|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.hpp|17|error: initializer specified for non-virtual method 'void Player::Turn(TicTacToe&amp;)'|<br />
||=== Build finished: 7 errors, 0 warnings ===|</p>
</blockquote>
<p>Bei diesen stellen:</p>
<pre><code class="language-cpp">// Field.hpp
#ifndef FIELD_HPP
#define FIELD_HPP

#include &quot;Player.hpp&quot;
#include &quot;Symbol.hpp&quot;

class Field
{
    private:
        bool visible;
        int rows,columns;
        Symbol* table;
    public:
        Field(int r, int c);
        void Init();

        void SetCell(Player&amp; p, int r, int c);
        Symbol GetCell(int r, int c) const;

        int GetRows() const;
        int GetColumns() const;

        int GetEmptyCells() const;

        void Show();
        void SetVisibility(bool status);
        bool IsVisible() const;
};

#endif // FIELD_HPP
</code></pre>
<pre><code class="language-cpp">// TicTacToe.hpp
#ifndef TICTACTOE_HPP
#define TICTACTOE_HPP

#include &quot;Player.hpp&quot;
#include &quot;Field.hpp&quot;

class TicTacToe
{
    private:
        Field* f;
        Player* p1;
        Player* p2;
        Player* pc; // Current Player
    public:
        TicTacToe(Player&amp; a, Player&amp; b, Field&amp; c);
        bool Turn(int r, int c);
        bool IsEnd();
        bool CheckSeries(Player&amp; p);
        bool Run();
};

#endif // TICTACTOE_HPP
</code></pre>
<p>Warum? für mich sieht alles ganz ok aus.</p>
<p>Mfg Alf! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/294343/not-a-type</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 22:38:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/294343.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 Oct 2011 16:35:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 16:35:28 GMT]]></title><description><![CDATA[<p>hallo ich habe folgenden Code, bei dem diese fehlermeldungen kommen:</p>
<blockquote>
<p>||=== TicTacToe, Debug ===|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Field.hpp|18|error: 'Player' has not been declared|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|12|error: 'Player' does not name a type|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|13|error: 'Player' does not name a type|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|14|error: 'Player' does not name a type|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|16|error: expected ')' before '&amp;' token|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\TicTacToe.hpp|19|error: 'Player' has not been declared|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.hpp|17|error: initializer specified for non-virtual method 'void Player::Turn(TicTacToe&amp;)'|<br />
||=== Build finished: 7 errors, 0 warnings ===|</p>
</blockquote>
<p>Bei diesen stellen:</p>
<pre><code class="language-cpp">// Field.hpp
#ifndef FIELD_HPP
#define FIELD_HPP

#include &quot;Player.hpp&quot;
#include &quot;Symbol.hpp&quot;

class Field
{
    private:
        bool visible;
        int rows,columns;
        Symbol* table;
    public:
        Field(int r, int c);
        void Init();

        void SetCell(Player&amp; p, int r, int c);
        Symbol GetCell(int r, int c) const;

        int GetRows() const;
        int GetColumns() const;

        int GetEmptyCells() const;

        void Show();
        void SetVisibility(bool status);
        bool IsVisible() const;
};

#endif // FIELD_HPP
</code></pre>
<pre><code class="language-cpp">// TicTacToe.hpp
#ifndef TICTACTOE_HPP
#define TICTACTOE_HPP

#include &quot;Player.hpp&quot;
#include &quot;Field.hpp&quot;

class TicTacToe
{
    private:
        Field* f;
        Player* p1;
        Player* p2;
        Player* pc; // Current Player
    public:
        TicTacToe(Player&amp; a, Player&amp; b, Field&amp; c);
        bool Turn(int r, int c);
        bool IsEnd();
        bool CheckSeries(Player&amp; p);
        bool Run();
};

#endif // TICTACTOE_HPP
</code></pre>
<p>Warum? für mich sieht alles ganz ok aus.</p>
<p>Mfg Alf! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134816</guid><dc:creator><![CDATA[Alf321]]></dc:creator><pubDate>Sun, 23 Oct 2011 16:35:28 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 16:37:45 GMT]]></title><description><![CDATA[<p>Ich würde mal sagen, dass Player.hpp Field.hpp oder TicTacToe.hpp inkludiert, was dann einen zyklischen include gibt und einen solchen Fehler erzeugt.<br />
Siehe dazu hier:<br />
<a href="http://www.drakon.ch/?id=&amp;offset=5&amp;mobile=0&amp;show_entry=77" rel="nofollow">http://www.drakon.ch/?id=&amp;offset=5&amp;mobile=0&amp;show_entry=77</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134818</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 23 Oct 2011 16:37:45 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 17:32:59 GMT]]></title><description><![CDATA[<p>Jetzt funktioniert das super, doch nun kommt auch gleich das nächste problem <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
Ich bekomme bei diesem konstruktor</p>
<pre><code class="language-cpp">Player::Player(char s)
{
    this-&gt;points = 0;
    this-&gt;symbol(s);
}
</code></pre>
<p>folgendes</p>
<blockquote>
<p>D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.cpp||In constructor 'Player::Player(char)':|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.cpp|4|error: no matching function for call to 'Symbol::Symbol()'|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Symbol.hpp|10|note: candidates are: Symbol::Symbol(char)|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Symbol.hpp|6|note: Symbol::Symbol(const Symbol&amp;)|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.cpp|7|error: no match for call to '(Symbol) (char&amp;)'|<br />
||=== Build finished: 4 errors, 0 warnings ===|</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2134835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134835</guid><dc:creator><![CDATA[Alf321]]></dc:creator><pubDate>Sun, 23 Oct 2011 17:32:59 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 17:45:47 GMT]]></title><description><![CDATA[<p>Probier</p>
<pre><code class="language-cpp">Player::Player(char s):
symbol(s),
points(0)
{}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2134842</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134842</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 23 Oct 2011 17:45:47 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 17:50:08 GMT]]></title><description><![CDATA[<p>Alf321 schrieb:</p>
<blockquote>
<p>Jetzt funktioniert das super, doch nun kommt auch gleich das nächste problem <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
Ich bekomme bei diesem konstruktor</p>
<pre><code class="language-cpp">Player::Player(char s)
{
    this-&gt;points = 0;
    this-&gt;symbol(s);
}
</code></pre>
<p>folgendes</p>
<blockquote>
<p>D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.cpp||In constructor 'Player::Player(char)':|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.cpp|4|error: no matching function for call to 'Symbol::Symbol()'|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Symbol.hpp|10|note: candidates are: Symbol::Symbol(char)|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Symbol.hpp|6|note: Symbol::Symbol(const Symbol&amp;)|<br />
D:\Eigene Dateien\Development Location\Projekte\TicTacToe\Player.cpp|7|error: no match for call to '(Symbol) (char&amp;)'|<br />
||=== Build finished: 4 errors, 0 warnings ===|</p>
</blockquote>
</blockquote>
<p>Mach es lieber so:</p>
<pre><code class="language-cpp">Player::Player(char s)
    :points(0), symbol(s)
{}
</code></pre>
<p>mfg D3lta</p>
<p>P.S.: Du kannst keinen Konstruktor per Hand aufrufen <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/2134846</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134846</guid><dc:creator><![CDATA[D3lta]]></dc:creator><pubDate>Sun, 23 Oct 2011 17:50:08 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 17:53:35 GMT]]></title><description><![CDATA[<p>Danke, so funktionierts <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134851</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134851</guid><dc:creator><![CDATA[alf321]]></dc:creator><pubDate>Sun, 23 Oct 2011 17:53:35 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 18:53:47 GMT]]></title><description><![CDATA[<p>D3lta schrieb:</p>
<blockquote>
<p>P.S.: Du kannst keinen Konstruktor per Hand aufrufen <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>
</blockquote>
<p>Wie meinst du das? Natürlich kann man das.</p>
<p>P.S.: Du hast genau dasselbe wie ich geschrieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134872</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 23 Oct 2011 18:53:47 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 18:59:58 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>P.S.: Du hast genau dasselbe wie ich geschrieben.</p>
</blockquote>
<p>Schade, wie oberflächlich manche Programmierer sind. Sie wissen nicht, dass es nur eine legale Reihenfolge der Initialisierungsliste gibt. Noch schlimmer: Sie erkennen die Reihenfolge nicht einmal mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134876</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134876</guid><dc:creator><![CDATA[unexaktor]]></dc:creator><pubDate>Sun, 23 Oct 2011 18:59:58 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 19:06:41 GMT]]></title><description><![CDATA[<p>[quote=&quot;unexaktor&quot;]</p>
<p>Hacker schrieb:</p>
<blockquote>
<p>Sie wissen nicht, dass es nur eine <strong>legale</strong> Reihenfolge der Initialisierungsliste gibt.</p>
</blockquote>
<p>Wusste garnicht, dass das einen Unterschied macht.<br />
Belehr mich.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134878</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134878</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 23 Oct 2011 19:06:41 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 19:28:32 GMT]]></title><description><![CDATA[<p>C++ Standard (12.6.2.5) schrieb:</p>
<blockquote>
<p>Initialization shall proceed in the following order: [...] nonstatic data members shall be initialized in the order they were declared in the class definition (again regardless of the order of the mem-initializers) [...]</p>
</blockquote>
<p>Leute wie Scott Meyers leiten daraus die Regel ab, dass die Reihenfolge der Initialisierungsliste der Reihenfolge der Deklaration entsprechen soll. Gute Compiler halten sich daran.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134884</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134884</guid><dc:creator><![CDATA[unexaktor]]></dc:creator><pubDate>Sun, 23 Oct 2011 19:28:32 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Sun, 23 Oct 2011 20:25:09 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Wusste garnicht, dass das einen Unterschied macht.</p>
</blockquote>
<p>Blöderweise geben einige Compiler wie der MSVC keine Warnung aus, wenn man dagegen verstößt.</p>
<p>Wenn man also nur diese Compiler verwendet, ist es natürlich klar, dass diese Regel in Vergessenheit gerät - ich habe mich lange Zeit nicht daran gehalten, bis mich ein Kollege darauf aufmerksam gemacht hat <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2134894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2134894</guid><dc:creator><![CDATA[Hmmh]]></dc:creator><pubDate>Sun, 23 Oct 2011 20:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to Not a Type on Mon, 24 Oct 2011 10:00:51 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Wusste garnicht, dass das einen Unterschied macht.</p>
</blockquote>
<p>Es macht keinen Unterschied, das ist der Witz an der Sache - in beiden Versionen werden die Variablen in der Reihenfolge initialisiert, in der sie in der Klassendefinition stehen, unabhängig von der Reihenfolge in der Initialisierungsliste.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2135013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2135013</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 24 Oct 2011 10:00:51 GMT</pubDate></item></channel></rss>