inherit/amphtest.cpp

The following code example is taken from the book
Object-Oriented Programming in C++
by Nicolai M. Josuttis, Wiley, 2002
© Copyright Nicolai M. Josuttis 2002


// header file for the class Amph
#include "amph.hpp"

int main()
{
    /* create amphibious vehicle and initialize
     * with 7 kilometers and 42 sea miles
     */
    CPPBook::Amph a(7,42);

    // output distance traveled
    a.printTraveled();
}