D
Drew
Hello:
I am having trouble getting a vector of a class to work from another class
//********************
class CaClass{
int idata;
CaClass(){idata =1;}
}
//********************
//********************
class CanotherClass{
vector <CaClass> aClass;
int iotherdata;
}
//********************
main()
{
CanotherClass anotherClass;
anotherClass->aClass.push_back(CaClass); //compiles fine but this
fails
}
//*********************************************************
Any ideas?
Know of any example that demo a vector used from within another class?
Thank you.
Drew
I am having trouble getting a vector of a class to work from another class
//********************
class CaClass{
int idata;
CaClass(){idata =1;}
}
//********************
//********************
class CanotherClass{
vector <CaClass> aClass;
int iotherdata;
}
//********************
main()
{
CanotherClass anotherClass;
anotherClass->aClass.push_back(CaClass); //compiles fine but this
fails
}
//*********************************************************
Any ideas?
Know of any example that demo a vector used from within another class?
Thank you.
Drew