【发布时间】:2011-12-27 15:12:51
【问题描述】:
如何在具有常量类变量的类中声明一个常量数组?可能吗。 我不想要动态数组。
我的意思是这样的:
class test
{
const int size;
int array[size];
public:
test():size(50)
{}
}
int main()
{
test t(500);
return 0;
}
以上代码报错
【问题讨论】:
标签: c++ arrays class variables constants