Main Content

Objects and Inheritance in C++ - an easy start

Archive - Originally posted on "The Horse's Mouth" - 2010-07-01 16:58:49 - Graham Ellis

We can end up with a lot of files when we do even a simple C++ example to show inheritance - a file for the main program, a file each for the base class and subclass, and a header file for the prototypes for each of the base class and subclass too.

So it's much easier to do it all as one file - but suggest to the delegates that the code should be split across multiple files once it's functioning. And I have added an example - [here] - to our web site to show the fundamentals all in one, to give newcomers to objects and inheritance in C++ an easy start.