I've never touched them and the book I have is really old and doesn't even mention them. I think they are used to avoid confusion between naming of class functions, but how do you use them, and what is the syntax? Anyone care to explain? Thanks.
I've never touched them and the book I have is really old and doesn't even mention them. I think they are used to avoid confusion between naming of class functions, but how do you use them, and what is the syntax? Anyone care to explain? Thanks.
Simple. Lets say you define two classes with the same name. Namespacing allows you to be able to differenciate between the two. For example: one::Class, two::Class. It's simple to do:
You can now reference them as SomeLib::String and one::String.Code:// one.h namespace one { char func(char); class String { ... }; } // somelib.h namespace SomeLib { class String { ... }; }
Get it?
(For more information check out http://msdn.microsoft.com/library/de...namespaces.asp and http://msdn.microsoft.com/library/de...namespaces.asp)
-Mike
{InFeStEd-ArCh0n}
Your old book didn't talk about them because namespaces are relatively new.
Yeah that's what I was implying.