struct myStrcut 
{
int a;
int b;
CArray<int ,int> testaa;
}; CArray<myStrcut,myStrcut> morantest;

myStrcut my1,my2;
my1.a = 1;
my1.b = 2;
my1.testaa.Add(12);
my1.testaa.Add(13);
my2.a = 10;
my2.b = 20;
my2.testaa.Add(120);
my2.testaa.Add(130);

morantest.Add(my1);
morantest.Add(my2);
for (int i=0; i< morantest.GetCount();i++)
{ TRACE2("\n a = %d ; b = %d ",myStrcut(morantest.GetAt(i)).a ,myStrcut(morantest.GetAt(i)).b); for (int j = 0; j< myStrcut(morantest.GetAt(i)).testaa.GetCount();j++ )
{
TRACE1("\n testaa = %d ;",myStrcut(morantest.GetAt(i)).testaa.GetCount()/*GetAt(j)*/);
}
}提示错误:
Error 1 error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' e:\program files\microsoft visual studio 8\vc\atlmfc\include\afxtempl.h 272