M
Michael Sgier
Hello
with the original code below I get the error:
"forward declaration of `struct CPlayer'"
class CPlayer; // what does this do? Instantiate the class CPlayer?
// what's a forward declaration?
class CEnemy : public CEntity
{
public:
CPlayer *player;
}
I tried it like this which brought the error:
"error: syntax error before `*' token"
class CEnemy : public CEntity
{
public:
// CPlayer *player;
CPlayer* player = new CPlayer;
}
THANKS for you help and regards.
Michael
with the original code below I get the error:
"forward declaration of `struct CPlayer'"
class CPlayer; // what does this do? Instantiate the class CPlayer?
// what's a forward declaration?
class CEnemy : public CEntity
{
public:
CPlayer *player;
}
I tried it like this which brought the error:
"error: syntax error before `*' token"
class CEnemy : public CEntity
{
public:
// CPlayer *player;
CPlayer* player = new CPlayer;
}
THANKS for you help and regards.
Michael