Q:
How would I go about making a vector of structs a private data member of a class?
I tried putting it in as just:
But I get errors to the effect of:Code:private: vector<Trick> myTricks(1);
'Invalid use of undefined type'
'Forward declaration of class'
'Template argument 1 is invalid'
'Template argument 2 is invalid'
'Invalid data member initialization'
'ISO C++ forbids declaration of myTricks with no type'
myTricks is defined as:
If it matters, this is declared in class Pet, which is a subclass of Animal and a superclass of Dog and Cat.Code:struct Trick { string name; int time; int diff; };



LinkBack URL
About LinkBacks


