그래서 C++로 텍스트 기반 게임을 만들려고합니다. Visual Studio 2010을 사용하고 있습니다. 다음은 내가 생각하는 일부 코드 블록입니다. 더 이상 필요하면 저에게 물어 보는 것을 주저하지 마십시오.오류 C2065 : '아무데도': 선언되지 않은 식별자
장소라는 게임에 대한 클래스를 만들려고합니다. 나는 장소를 만들고 그것의 북쪽, 남쪽, 동쪽, 그리고 서쪽에 또 하나의 "장소"를 가지고있다. 나는 지금 당장 혼란스러워. 나는이 물건에 멍청 아. 나는 무언가를 조사하고 있을지도 모른다.
//places.h------------------------
#include "place.h"
//Nowhere place
string nowheredescr = "A strange hole to nowhere";
place nowhere(&nowheredescr, &nowhere, &nowhere, &nowhere, &nowhere); //Error occurs here
//
//place.h------------------------
#ifndef place_h
#define place_h
#include "classes.h"
class place
{
public:
place(string *Sdescription, place *Snorth, place *Ssouth, place *Swest, place *Seast);
~place(void);
private:
string *description;
place *north;
place *south;
place *east;
place *west;
};
#endif
//place.cpp-------------------
#include "place.h"
#include <iostream>
place::place(string *Sdescription, place *Snorth, place *Ssouth, place *Swest, place *Seast)
{
description = Sdescription;
north = Snorth;
south = Ssouth;
west = Swest;
east = Seast;
}
place::~place(void)
{
}
@ dasblinkenlight 님의 제안으로 업데이트되었습니다. – superzilla
@ dasblinkenlight 나는이 4 번 : "1> c : \ 사용자 \ jackson \ google 드라이브 \ public \ C++ projects \ parabellum \ parabellum \ places.cpp (5) : C2065 오류 : '아무데도 : 알 수없는 식별자" 그리고 어떤 이유로 귀하의 답변이 삭제되었습니다. – superzilla