home *** CD-ROM | disk | FTP | other *** search
- // ex06003.cpp
- // Anonymous objects
- #include <iostream.h>
-
- main()
- {
- int actualint = 123;
- long& otherint = actualint;
-
- cout << "\nactualint: " << actualint;
- cout << "\notherint: " << otherint;
-
- cout << "\nassign 0 to otherint";
- otherint = 0;
- cout << "\nactualint: " << actualint;
- cout << "\notherint: " << otherint;
-
- cout << "\nincrement otherint";
- otherint++;
- cout << "\nactualint: " << actualint;
- cout << "\notherint: " << otherint;
-
- cout << "\nincrement actualint";
- actualint++;
- cout << "\nactualint: " << actualint;
- cout << "\notherint: " << otherint;
- }