+ 2

What is namespace? What are its uses? How can we create our own namespace?

25th Oct 2017, 1:53 PM
Rahul Dev
Rahul Dev - avatar
3 Answers
+ 3
This is a good description of namespace: http://www.cplusplus.com/doc/tutorial/namespaces/ There are people out there that believe using them is evil. It can cause access problems and confusion.
25th Oct 2017, 2:00 PM
John Wells
John Wells - avatar
+ 2
Thanks @JohnWells
25th Oct 2017, 2:01 PM
Rahul Dev
Rahul Dev - avatar
+ 2
John is right, I've seen a lot of people show that type of thought toward it. However, think of it as a collection of related classes and such. Allows you to properly group things up that relate to one another, and even better, it allows you to prevent naming conflicts between the classes. I haven't checked out the link John posted, but I would check it out and learn how to properly use them. Very useful.
25th Oct 2017, 2:03 PM
AgentSmith