Files Classes Functions Hierarchy
#include <iostream>#include <visitbase.h>#include <visitdataA.h>#include <visitdataB.h>#include <visitprint.h>#include <visitdataC.h>
Go to the source code of this file.
Functions | |
| void | test03 () |
| int | main (int argc, char **argv) |
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
| void test03 | ( | ) |
Definition at line 12 of file main.cpp.
00013 { 00014 visitbase *pA = new visitdataA(13); 00015 visitbase *pB = new visitdataB("cat"); 00016 00017 visitbase *f = new visitprint(); 00018 00019 cout << "Try A(print)" << endl; 00020 (*pA)(f); 00021 cout << "Now try the reverse print(A)" << endl; 00022 (*f)(pA); 00023 00024 cout << "Try B(print)" << endl; 00025 (*pB)(f); 00026 cout << "Now try the reverse print(B)" << endl; 00027 (*f)(pB); 00028 00029 cout << endl; 00030 cout << "Now a new data member C is implemented" << endl; 00031 cout << "It has to work with the exiting print operator" << endl; 00032 00033 visitbase *pC = new visitdataC(1,3); 00034 cout << "Try matching a print and a C with print(C)" << endl; 00035 (*f)(pC); 00036 00037 }
1.5.8