1
0

twofile2.cpp 515 B

123456789101112131415
  1. // twofile2.cpp -- variables with internal and external linkage
  2. #include <iostream>
  3. extern int tom; // tom defined elsewhere
  4. static int dick = 10; // overrides external dick
  5. int harry = 200; // external variable definition,
  6. // no conflict with twofile1 harry
  7. void remote_access()
  8. {
  9. using namespace std;
  10. cout << "remote_access() reports the following addresses:\n";
  11. cout << &tom << " = &tom, " << &dick << " = &dick, ";
  12. cout << &harry << " = &harry\n";
  13. }