0
namespace std;
Guys, can anyone tell me what's the actual use of namespace std & why it's too important. :)
3 odpowiedzi
+ 7
Interesting question! I am also learning C++ and still haven't had a good grip on this subject, and so I did little search, and in one of the results I found the following (quoted from codingunit.com)
"Namespaces are used in the C++ programming language to create a separate region for a group of variables, functions and classes etc. Namespaces are needed because there can be many functions, variables for classes in one program and they can conflict with the existing names of variables, functions and classes. C++ uses namespace to avoid the conflicts."
[CodingUnit - Namespaces and anonymous namespaces]
https://www.codingunit.com/cplusplus-tutorial-namespaces-and-anonymous-namespaces
Some other articles related to namespace in C++:
http://en.cppreference.com/w/cpp/language/namespace
http://www.informit.com/articles/article.aspx?p=1896673&seqNum=2
http://www.studytonight.com/cpp/namespace-in-cpp.php
Thanks for bringing this up, I learned something from this question : )
Hth, cmiiw
+ 2
@Ipang your welcome and your response helped me a lot.
0
it is a declarative region for the identifiers (the names of types, functions, variables, etc) inside it.