| | 45 | #ifndef __HELLO_WORLD__ |
| | 46 | #define __HELLO_WORLD__ |
| | 47 | |
| | 48 | class hello |
| | 49 | { |
| | 50 | public: |
| | 51 | // constructor |
| | 52 | hello () {} |
| | 53 | |
| | 54 | // desctructor |
| | 55 | ~hello (){} |
| | 56 | |
| | 57 | // function example |
| | 58 | void print (); |
| | 59 | }; |
| | 60 | |
| | 61 | #endif // __HELLO_WORLD__ |
| | 62 | > more src/hello.cxx |
| | 63 | ////////////////////////////////////////////////// |
| | 64 | // author: vincent garonne // |
| | 65 | // date: 4/5/2005 // |
| | 66 | // description: hello world body // |
| | 67 | ////////////////////////////////////////////////// |
| | 68 | |
| | 69 | using namespace std; |
| | 70 | #include <iostream> |
| | 71 | |
| | 72 | #include "hello.h" |
| | 73 | |
| | 74 | void hello::print () |
| | 75 | { |
| | 76 | cout<<"Hello le world !!!"<<endl; |
| | 77 | } |
| | 78 | > more src/main.cxx |
| | 79 | ////////////////////////////////////////////////// |
| | 80 | // author: vincent garonne // |
| | 81 | // date: 4/5/2005 // |
| | 82 | // description: main program // |
| | 83 | ////////////////////////////////////////////////// |
| | 84 | #include "hello.h" |
| | 85 | |
| | 86 | int main () |
| | 87 | { |
| | 88 | hello object; |
| | 89 | object.print(); |
| | 90 | return 0; |
| | 91 | } |
| | 92 | |
| | 93 | }}} |