I have a 'god' class and a 'person' class that both derive from the 'universal' class. The universal class does things like set their names and ages (simple stuff). I am trying to make a 'god' method that creates new people by using a vector. This is how I usually use my vectors:
I want to have basically the same thing in my createpeople method in the god classCode:typedef vector<type*> TypeVector; TypeVector NewVector; NewVector.push_back(new type);
it says that person is an undeclared identifierCode:void createpeople(int people) { typedef vector<person*> PersonVector; PersonVector People; cout << endl << "Creating people" << endl; for(x = 0; x < people; x++) People.push_back(new person); godspeople = people; }



LinkBack URL
About LinkBacks


