home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Ebooks / Thinking in C++ V2 / C19 / applyGromit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-25  |  564 b   |  22 lines

  1. //: C19:applyGromit.cpp
  2. // From Thinking in C++, 2nd Edition
  3. // Available at http://www.BruceEckel.com
  4. // (c) Bruce Eckel 1999
  5. // Copyright notice in Copyright.txt
  6. // Test applySequence.h
  7. #include "Gromit.h"
  8. #include "applySequence.h"
  9. #include <vector>
  10. #include <iostream>
  11. using namespace std;
  12.  
  13. int main() {
  14.   vector<Gromit*> dogs;
  15.   for(int i = 0; i < 5; i++)
  16.     dogs.push_back(new Gromit(i));
  17.   apply(dogs, &Gromit::speak, 1);
  18.   apply(dogs, &Gromit::eat, 2.0f);
  19.   apply(dogs, &Gromit::sleep, 'z', 3.0);
  20.   apply(dogs, &Gromit::sit);
  21. } ///:~
  22.