【发布时间】:2013-10-20 10:11:26
【问题描述】:
我有问题。我想在类的构造函数中初始化我的 2Dim 数组,它是类的成员。例如。
class Foo
{
private:
bool testArray[100][4];
public:
Foo( bool t_array[][4]);
};
在 Foo.cpp 文件中:
Foo::Foo(bool array[][4])
{
// initilize it in there with unknown row size
}
我没有具体的行大小,但我知道它最大为 100。
如何在我的构造函数中初始化我的 testArray?提前致谢。
【问题讨论】:
标签: c++ multidimensional-array constructor