Bring only a few names into the global namespace : global namespace « Language Basics « C++ Tutorial






#include <iostream>

// gain access to cout, cin, and hex
using std::cout;
using std::cin;
using std::hex;

int main()
{
  int val;

  cout << "Enter a number: ";

  cin >> val;
  cout << "This is your number: ";
  cout << hex << val; 
  return 0;
}
Enter a number: 1
This is your number: 1








1.10.global namespace
1.10.1.Use explicit std:: qualification
1.10.2.Bring only a few names into the global namespace