> I would have to change each and every cout which could be tedious.
That's why editors have global search and replace features
Rather than dragging in the whole of the std namespace, you have some options.
Bite the bullet and do a global search/replace.
Code:
#include <iostream>
#include <iomanip>
int main ( ) {
int var;
std::cout << "Type some int" << std::endl;
std::cin >> var;
std::cout << "You typed " << var << std::endl;
}
Only mention the parts of the std namespace you're interested in (or use the most)
Code:
#include <iostream>
#include <iomanip>
using std::cout; // we do this a lot.
int main ( ) {
int var;
cout << "Type some int" << std::endl;
std::cin >> var;
cout << "You typed " << var << std::endl;
}
When you start writing much larger programs, you'll come across libraries which have their own namespaces as well (random example).
In short, "using namespace std;" will get you out of the immediate porting hole you're in, but you shouldn't be using it as a way of being lazy in new code.