Advertisement
Syndragonic

Display 12.5 CS311

Oct 27th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1.  #include <iostream>
  2.  using namespace std;
  3.  
  4.  namespace savitch1
  5.  {
  6.  void greeting( );
  7.  }
  8.  
  9.  namespace savitch2
  10.  {
  11.  void greeting( );
  12.  }
  13.  
  14.  void big_greeting( );
  15.  
  16.  int main( )
  17.  {
  18.  {
  19.  using namespace savitch2;
  20.  greeting( );
  21.  }
  22.  
  23.  {
  24.  using namespace savitch1;
  25.  greeting( );
  26.  }
  27.  
  28.  big_greeting( );
  29.  
  30.  return 0;
  31.  }
  32.  
  33.  namespace savitch1
  34.  {
  35.  void greeting( )
  36.  {
  37.  cout << "Hello from namespace savitch1.\n";
  38.  }
  39.  }
  40.  
  41.  namespace savitch2
  42.  {
  43.  void greeting( )
  44.  {
  45.  cout<< "Greetings from namespace savitch2.\n";
  46.  }
  47.  }
  48.  
  49.  void big_greeting( )
  50.  {
  51.  cout<< "A Big Global Hello!\n";
  52.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement