我有一个小的 C++ 程序定义如下:
class Test
{
public:
int a;
int b[a];
};
编译时,会产生错误:
testClass.C:7:5: error: invalid use of non-static data member ‘Test::a’
testClass.C:8:7: error: from this location
testClass.C:8:8: error: array bound is not an integer constant before ‘]’ token
我如何了解错误消息的含义,以及如何修复它?