我知道什麼「預期主要表達式之前int」的意思,但我從來沒有見過在此上下文中使用的錯誤之前。它堅持指向我的程序頭(int main())。預期的主要表達式之前int main()
有人請賜教我這是什麼意思?我的大部分程序都以int main()開頭,沒有問題。
謝謝!
#include <string>
#include <iostream>
#include <vector>
#include "Game.hpp"
int main(){ // <---------------- Causing error
GameCell::Element wind("wind",10.0),
temp("temp",50.0),
precip("precip",0.0);
std::vector<GameCell::Element> testElements;
testElements.push_back(wind);
testElements.push_back(temp);
testElements.push_back(precip);
Game * test = new Game(3,testElements);
//GameCell GC(0, 0, 0, 0, 0, testElements, 1);
//GC.display();
return 0;
}
'Game.hpp'的內容是什麼? – jwodder 2014-10-28 02:27:31
'game.hpp'裏有什麼? – John3136 2014-10-28 02:27:33
錯誤必須在頭文件'Game.hpp'中 – jpw 2014-10-28 02:27:55