S R T B H P N

Soldiers.h, Soldiers.cpp, Soldiers.txt, Code folder, Inheritance webpage

This code illustrates how to build and use a polymorphic hierarchy of classes.

  chow time
 -----------
  Frank eating
  Sam eating
  George eating
  Charlie eating
  Slacker eating

  inspection
 ------------
  Captain Frank inspecting his 1st squad
  default salute
  Sir, my name is Sergeant Sam
    inspecting m16 carbine
  snappy salute
  Sir, my name is private George
    inspecting m16 carbine
    inspecting 40lb backpack
  snappy salute
  Sir, my name is private Charlie
    inspecting m16 carbine
    inspecting mortar
  snappy salute
  Sir, my name is private Slacker
    Sorry sir, I forgot my equipment

Press any key to continue . . .