적 클래스의 멤버에 액세스 할 수 없기 때문에 약간의 문제가 있습니다. 아마도 클래스 파일을 잘못 포함했을 것입니다. 내가 도대체 뭘 잘못하고있는 겁니까? 클래스 클래스클래스 멤버에 액세스 할 수 없습니다.
#include "classes.h"
class Enemy
{
bool alive;
double posX,posY;
int enemyNum;
int animframe;
public:
Enemy(int col,int row)
{
animframe = rand() % 2;
posX = col*50;
posY = row*50;
}
Enemy()
{
}
void destroy()
{
alive = 0;
}
void setposX(double x)
{x = posX;}
void setposY(double y)
{y = posY;}
};
내 헤더 내 CPP :
class Enemy;
내 주요 :
#include "classes.h"
Enemy alien;
int main()
{
alien. // this is where intelisense tells me there are no members
}
없음 데이터 멤버 또는 당신은뿐만 아니라 어떤 기능 회원을 의미하지 않는다? –