home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / C / ANSICPP.ZIP / EX06003.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-24  |  605 b   |  28 lines

  1. // ex06003.cpp
  2. // Anonymous objects
  3. #include <iostream.h>
  4.  
  5. main()
  6. {
  7.     int actualint = 123;
  8.     long& otherint = actualint;
  9.  
  10.     cout << "\nactualint: " << actualint;
  11.     cout << "\notherint:  " << otherint;
  12.  
  13.     cout << "\nassign 0 to otherint";
  14.     otherint = 0;
  15.     cout << "\nactualint: " << actualint;
  16.     cout << "\notherint:  " << otherint;
  17.  
  18.     cout << "\nincrement otherint";
  19.     otherint++;
  20.     cout << "\nactualint: " << actualint;
  21.     cout << "\notherint:  " << otherint;
  22.  
  23.     cout << "\nincrement actualint";
  24.     actualint++;
  25.     cout << "\nactualint: " << actualint;
  26.     cout << "\notherint:  " << otherint;
  27. }
  28.