I think, they mean that if we use namespace std before each command, it helps compiler to use namespace for that specific statement that we have in our code (avoid using all the character that we have in the namespace std)
What are namespaces for ?
To identify the objects of different kinds.
you want to avoid conflicts between stuff similarly named, using namespaces nullifies that advantage
to avoid naming collision
yeah, I got that. but in my opinion, compiler is smart enough to understand whether a variable is declared in namespace std or not and using the namespace std out of the main function or beside each command will not make that much difference. I mean the necessary thing is to have this expression in your code
but then someone reading your code might get confused too
i really hate to see using namespaces in example code
oo,, that's s.th else. I get your meaning now, thx
Yes, but also no
Обсуждают сегодня