Why use std::

Why do some people use std:: when you can use "using namespace std " ?

1
2
ng
  Put the code you need help with here.
ng
closed account (1vf9z8AR)
There is a good article on it on stack overflow
https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice

Although if you are doing coding for school or college don't bother using std again and again.

Just use "using namespace std;"
Last edited on
the 10 cent summary of the article is that std:: is huge beyond control and it is too easy to accidentally reuse common words that it defines, causing problems, eg min and max and many other common variable name candidates are defined in it.

you can use bits of it, eg using std::cout
Last edited on
Topic archived. No new replies allowed.