cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Why use std::
Why use std::
Apr 13, 2019 at 2:58pm UTC
arg57
(21)
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
Apr 13, 2019 at 3:03pm UTC
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
Apr 13, 2019 at 3:05pm UTC
Apr 13, 2019 at 4:33pm UTC
jonnin
(11444)
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
Apr 13, 2019 at 4:34pm UTC
Topic archived. No new replies allowed.