我想創建一個海戰遊戲。我有兩個類:Ship和Cell。C++未聲明標識符
#pragma once
#include"stdafx.h"
#include"Globals.h"
#include<vector>
#include"MCell.h"
class Ship
{
private:
int lenght;
int oriantation;
vector<Cell*> cells;
vector<Cell*> aroundCells;
...
#pragma once
#include<vector>
#include"MShip.h"
class Cell
{
private:
bool haveShip;
bool selected;
bool around;
int x;
int y;
Ship* ship;
,我已經得到了很多錯誤,如那些:
1>projects\seewar\seewar\mship.h(13): error C2065: 'Cell' : undeclared identifier
1>projects\seewar\seewar\mship.h(13): error C2059: syntax error : '>'
1>projects\seewar\seewar\mship.h(14): error C2065: 'Cell' : undeclared identifier
有什麼不好的代碼?
我已經完成了你的悲傷。但我得到了新的錯誤:矩陣[i] [j] =新單元格(i,j); 1> c:\ users \ ostap \ documents \ visual studio 2010 \ projects \ seewar \ seewar \ mplane.h(32):錯誤C2514:'單元':類沒有構造函數 – 2012-02-24 23:14:34
好吧..它的作品..非常感謝 – 2012-02-24 23:20:15