home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK4 / SAMPLES / CPPTUTOR / REFDEMO.CP$ / REFDEMO
Encoding:
Text File  |  1991-12-12  |  460 b   |  22 lines

  1. // REFDEMO.CPP
  2.  
  3. // This is an example program from Chapter 3 of the C++ Tutorial. This
  4. //     program demonstrates reference variables.
  5.  
  6. #include <iostream.h>
  7.  
  8. void main()
  9. {
  10.    int actualint = 123;
  11.    int &otherint = actualint;
  12.  
  13.    cout << '\n' << actualint;
  14.    cout << '\n' << otherint;
  15.    otherint++;
  16.    cout << '\n' << actualint;
  17.    cout << '\n' << otherint;
  18.    actualint++;
  19.    cout << '\n' << actualint;
  20.    cout << '\n' << otherint;
  21. }
  22.