Quantcast
Channel: C++: Array of parent and child objects - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article


Answer 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 Article


C++: 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
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>