Source of storage_linkage_aux1.cpp


  1: //storage_linkage_aux1.cpp
  2: //Goes with storage_linkage_main1.cpp. Compile the two files
  3: //separately and link the object files to produce an executable.
  4: //Contains the definition of a global variable n, and a global
  5: //function DoItToN().

  7: #include <iostream>
  8: using namespace std;

 10: int n = 6;  //This is a global n.

 12: void DoItToN()
 13: {
 14:     n = 10;
 15:     cout << "Inside DoItToN, n = " << n << endl;
 16:     ++n;
 17: }