开发平台(Platform): (Ex: VC++, GCC, Linux, ...)
GCC
问题(Question):
class AAA{
public:
int a=2;
int b=a+1;
int c[a];
};
喂入的资料(Input):
预期的正确结果(Expected Output):
应该可以正确宣告 一块大小是2个int的内存给阵列C阿?
错误结果(Wrong Output):
但gcc 在 int c[a]这行报错 改成int c[AAA::a] 也一样
改成int c[2]就ok
就是invalid use of not-static member data
有点白痴的问题 恳请板上先进指教! 感谢!