cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
lists, classes and inheritance
lists, classes and inheritance
Jun 10, 2015 at 8:58pm UTC
very novice
(9)
Is it possible to create a list whose members consist of different classes, which derive from the same base class?
Jun 10, 2015 at 9:08pm UTC
shadowmouse
(539)
Not exactly, but you can create a list of pointer-to-base-class, which can then point to either the base class or any of the derived classes. The polymorphism tutorial is what you should be looking at for this.
Topic archived. No new replies allowed.