// OopDynaHello.C // (c) Burt Rosenberg 1996 // An introduction to pointers and dynamic // creation of objects. #include class Greetings { public: // for simplicity, it's all public const int size = 20 ; char message[size] ; // METHODS void set( char m[] ) ; void print( void ) ; } ; // Implement the methods void Greetings:: set ( char m[] ) { int i ; for ( i=0; iset( "Hello World" ) ; // gp points to print method. gp->print() ; // destruction of gp. delete gp ; }