【发布时间】:2020-04-06 10:02:22
【问题描述】:
我这里有一个代码,但是我不知道错误在哪里,也没有在网上找到任何有用的东西。
#ifndef TICTACTOE_H
#define TICTACTOE_H
#include <iostream>
#include <string>
class TicTacToe {
public:
int lines = 3;
int columns = 3;
std::string grid[lines][columns] = { { "#", "#", "#" }, { "#", "#", "#" }, { "#", "#", "#" } };
};
#endif
我在 [] 括号中的行和列处收到错误消息:
非静态成员引用必须是相对于某个对象的
我希望你能帮助我。
【问题讨论】:
标签: c++