I would like to create an array of structure in C++. I do not know the size so I would like to make it dynamic. I have tried with CList but I have failed. So I tried using a vector but I have the same error.
I have the following structure in my header :
typedef CArray<CArray<double, double>,double> ObjectArray;
struct MyStruct {
CString type;
CString name;
ObjectArray value;
};
std::vector<MyStruct> ST;
In my cpp file, I have the following code to populate my array. STR is a structure I populated beforehand.
ST.push_back(STR);
I have the following error when building:
c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(262): error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject
I guess I am doing something wrong but I do not understand what I am missing.
STR?MyStruct(should be)?copy-constructorisprivate, but nothing can be said by seeing your code.