home *** CD-ROM | disk | FTP | other *** search
- // \EXAMPLES\EX0601.CPP
- // The HELLO WORLD program using a constructor and destructor
-
- #include <iostream.h> // for stream I/O
-
- class world { // definition of the class world
- public:
- world() { cout << "Hello World" << endl; }; // constructor
- ~world() { cout << "Goodbye" << endl; }; // destructor
- };
-
- world hello; // global object
-
- void main () // main
- { cout << "This is main." << endl; };
-