首页 > 解决方案 > 无法在 C++ 头文件中创建数组?

问题描述

我正在使用 SDL 和文件 InputPC.h 开发游戏" 为钥匙。

Class InputPC { 
public: 
InputPC(); 
~InputPC(); 
static void Tick();

static bool a;
static bool w;
static bool s;
static bool d;
static bool[] myarray;
static bool getA();
static bool getW();
static bool getS();
static bool getD();
}; 

myarray 行总是红色的,(我试过不使用静态)

标签: c++visual-studiosdl

解决方案


只是我将我的数组声明为
bool inputs[10];


推荐阅读