using namespace std::cout?

hi I'm having dificulties with this command:

1
2
3
4
5
#include <iostream>
using namespace std::cout
int main() {
//code
}


it does not compile,
I'm using VS2010, and would like to use only std::cout and not whole std namespace, I also have no willing in tiping std::cout for every outpu!

what's wrong?
Last edited on
using std::cout;
Thank you :D
There's nothing wrong with using the 'whole std namespace' even if you don't use every command.

1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;

int main()
{
      cout << "Hello World!" << endl;
      return 0;
}

is completely fine!
Topic archived. No new replies allowed.