2
因此,我正在尝试使用Visual Studio 2010在C++中制作基于文本的游戏。以下是我认为相关的一些代码块。如果你需要,不要犹豫,问我。错误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 2012-08-15 02:49:13
@dasblinkenlight我得到这4次:“1> c:\ users \杰克逊\谷歌驱动器\公共\ C++项目\ parabellum \ parabellum \ places.cpp(5):错误C2065:'无处':未声明的标识符” 由于某种原因,您的答案被删除:( – superzilla 2012-08-15 02:52:57