home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-10-21 | 566 b | 38 lines | [TEXT/CWIE] |
- #include <iostream.h>
-
-
- //--------------------------------------- MyClass
-
- class MyClass
- {
- public:
- const short kMaxNameLength;
- short &numberAlias;
- short number;
-
- MyClass( short constValue );
- };
-
- MyClass::MyClass( short constValue )
- : kMaxNameLength( constValue ), numberAlias( number )
- {
- number = kMaxNameLength;
-
- cout << "Before: number = "
- << number << "\n";
-
- numberAlias += 10;
-
- cout << "After: number = "
- << number << "\n";
- }
-
-
- //--------------------------------------- main()
-
- int main()
- {
- MyClass myObject( 10 );
-
- return 0;
- }