[問題] missing template arguments before 「[」 token
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
g++
問題(Question):
class使用global variable的時候有問題
錯誤結果(Wrong Output):
missing template arguments before 「[」 token
程式碼(Code):(請善用置底文網頁, 記得排版)
像是
using namespace std;
int map[10][10];
class test{
public:
int move(int a,int b);
};
int test::move(int p_x, int p_y){
int ID = std::map[p_x][p_y];
return ID;
}
補充說明(Supplement):
就會在 int ID = std::map[p_x][p_y]; 這行出現
missing template arguments before 「[」 token 這個錯誤
因為本身是因為本身是c++新手
所以想問一下這樣的寫法哪裡有問題
感謝各位版友!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 180.177.14.234
推
05/28 15:48, , 1F
05/28 15:48, 1F
→
05/28 15:50, , 2F
05/28 15:50, 2F
→
05/28 16:07, , 3F
05/28 16:07, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章