I need help on how using std. Is it good to put it as a (using namespace std);
or just put is as a std::(something);? If so do I need to put (using namespace std;) before the int main() or in the int main? Thanks.
Either way is exceptable but I think that most people prefer 'using namespace std',
You should put the using namespace at the top of file generally just under the #include
statements.
Putting usingnamespace std; globally defeats the entire point of using namespaces in the first place. It's fine for small, quick programs, but in larger projects it should be avoided.
I just made another post recently explaining why. Read this:
Thanks Disch. This was something that was confusing me by looking at several tutorials. Some said to use usingnamespace std; while others said to use std::something. Like you said, both are fine in smaller applications, and your explanation makes sense. Finally, something is starting to make sense....