我收到了“警告房间初始化程序周围缺少大括号”的错误,虽然我确实理解错误的含义,但我不明白为什么这么说。这是代码:
//manager.h
class mapManager
{
public:
mapManager();
private:
};
class room //how the map tiles will have attributes.
{
public:
//public because room needs to be accessible from map manager
int dir; //direction of the current tile
};
...
//manager.cpp(包括manager.h)
mapManager::mapManager()
{
room map[4][8] = {
{1, 2, 3, 4, 5, 6, 7, 8},
{1, 2, 3, 4, 5, 6, 7, 8},
{1, 2, 3, 4, 5, 6, 7, 8},
{1, 2, 3, 4, 5, 6, 7, 8}
};
}
我没有看到任何丢失的大括号!帮助?