Ask coding questions

← Back to all posts
Why do people manually type std in C++?
AtriDey (189)

Why not simply say

using namespace std;

and omit the std::? For example,

std::cout<<"Hello World!"<<endl;

rather than

using namespace std;

and

cout<<"Hello World!"<<endl;

Is there a benefit I don't know of?

Comments
hotnewtop
MrEconomical (2293)

I would write a reply but this one is way better than anything I could write
https://www.geeksforgeeks.org/using-namespace-std-considered-bad-practice/