c++ - Arrays enums and input -
i have enumerated data type for/in class. want set/assign values inside main. code looks like
class pet { public: enum species { bird,cat,dog,rat,horse }; enum demands { food,water,companionship }; demands demand; species petspecies; float waterlevel = 100; float foodlevel = 100; float happiness = 100; //species not initialized in class , have initialized separately in main string name; //and bunch of functions here , there };
inside main function using vector create set of pets each own name , species. setting species pets proving difficult.
how do it?
vector_pets[i].petspecies = pet::horse;
should want.
Comments
Post a Comment