Creating objects at run-time and overriding
P | N


First: Let's do it obvious, but wrong

#include <iostream.h>

class railroad_car {

public:

void display_short_name() {cout << "rrc";}

};

class box_car: public raiload_car {

public:

void display_short_name() {cout << "box";}

};

//..Similar definitions of tank_car, engine, and caboose go here


Previous | Next


Last modified at 8/5/97; 12:30:36 PM
Other Links of Interest
College of Computing | EduTech Institute | GVU Center
Mark Guzdial | Papers | CS 2390 Spring '97 Home Page | STABLE | MMC-CaMILE

Slide Master