Advertisement
Ejejejejejjr

Пространства имен(2)

Jan 1st, 2021
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4.  
  5. namespace NS1
  6. {
  7.     void Func()
  8.     {
  9.         std::cout << "Func NS1" << std::endl;
  10.     }
  11. }
  12.  
  13. namespace NS2
  14. {
  15.     void Func()
  16.     {
  17.         std::cout << "Func NS2" << std::endl;
  18.     }
  19. }
  20.  
  21. using namespace NS2;
  22.  
  23. int main(int argc, char *argv[])
  24. {
  25.     setlocale(LC_ALL, "Rus");
  26.     srand(time(NULL));
  27.    
  28.     NS1::Func();
  29.    
  30.     Func();
  31.    
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement