std::vector for parent and child class
问题 I need to create a vector that can contain my parent class and sub class data. This is what i do.. Vehicle is the parent class Car is the child class About Car.cpp , it got the following struct Point { int x,y }; class Car : public Vehicle { private: Point wheelPoint[4]; double area; public: void setPoint(); }; void Car::setPoint() { int xData,yData; cout << "Please enter X:"; cin >> xData; cout << "Please enter Y:"; cin >> yData; wheelPoint[i].x = xData; wheelPoint[i].y = yData; } Then at my