std::cout << "Like this." << std::endl;
I don't think it's necessarily advanced users. I think readability is one reason. You're also not going to get any errors due to ambiguity in variable names.
They're my two reasons.
using namespace std;
std::cout << '[';
cout << endl;
int endl = 0;
cout << endl << std::endl;
std::cout << ']';
cout referes to std::cout. Before endl was declared as an int, it use to refer to std::endl, but after it now is an int.
Last edited on
That seems very situational for so many people(That ive seen) to use it
When you do
using namespace std; you are taking everything in the std namespace (not just the stuff you wanted... but everything) and dumping it into the global namespace.
This defeats the entire purpose of having a namespace to begin with. The whole point is to keep things separate so that there is less confusion and less chance of a name conflict.