0
我得到这个错误在我的结构的构造函数。为什么我得到它只因为*指针而不是**。Dyanmic结构错误,指针转换
错误:
\ListStruc.cpp:26:25: error: cannot convert 'int**' to 'int*' in assignment
struct.h
struct Arr{
int days;
int *M;
};
typedef Arr* Array;
struct.cpp
void constr(Array &o){
//Construct of 1*31 Matrix
o=new Arr;
o->days = days;
o->M = new int*[o->days];
谢谢>。> 如何初始化数组的对象我得到错误int不能被转换为Expre,成为我的课程。 – 2012-04-11 19:53:49
@BogdanMaier我从字面上理解你刚才所说的任何话。 – 2012-04-11 20:03:51
我修正了错误。现在我很期待创建该数组,我必须在构造函数/头文件中声明一个类对象数组,或者我应该怎么做,因为类不是类型,我不知道该怎么做? – 2012-04-11 20:22:00