↧
Answer by John3136 for C++: Array of parent and child objects
By "access special methods" I assume you mean methods in just the OpenPlayer or just the ClosedPlayer?By array, I assume you mean some STL collection ;-)The short answer is "No".The long answer is "Yes...
View ArticleAnswer by Ernest Friedman-Hill for C++: Array of parent and child objects
In general, you can't make a C++ array whose elements are of different class types; each array element must be the same size, and that won't necessarily be true of different subclasses. Putting...
View ArticleC++: Array of parent and child objects
I am designing a game in which some players cards are known and some aren't. To do this, I made a parent object "Player" with children "OpenPlayer" and "ClosedPlayer".I want to make an array of all the...
View Article