CS115 Exercise: C++ Virtual Functions
file from the CS Dept's anonymous ftp site to your Hercules account space. Do that by:
Entering the command:
cp /net/data/ftp/pub/class/170/ftp/cpp/Vfuncs/vfuncs-noptrs.cpp vfuncs.cpp
OR, by doing a copy and paste from the screen to an edit session,
OR, by using the command line FTP program using this information:
The path: pub/class/170/ftp/cpp/Vfuncs
The file: vfuncs-noptrs.cpp
The purpose of the program is to illustrate the concept of polymorphism by creating derived classes that define their own operations in virtual functions.
A base class contains a pure virtual function but the actual function definitions are contained in the individual derived class functions.
Compile and run this C++ program.
Modify the code as indicated by the comments in the program.
Compile and run this program again.
CS Dept Home Page
CS Dept Class Files
CS115 Lab Files
Copyright: Department of Computer Science, University of Regina.