Create a private namespace in C++

Hi. I want to create a namespace that supports my whole library files and classes.
But i don't know how to create a namespace.
Can anyone tell me how to do that ?
There is a question here :
if i want to add classes and objects to a namespace from another library ?
for example :
I have a namespace called namespace1.
and i have a library called library.h
i have a function or class in library.h and i want to add it to the namespace1.
Is there any way to do it ?
By editing library.h. Or maybe you can get away with:
1
2
3
namespace namespace1 {
    #include "library.h"
}
What do you mean from Editing library.h ?
library.h:
1
2
3
4
5
6
7
namespace namespace1 {
//this is the first line of library.h
//this is more of library.h
//I have no clue what is here
//there could be a function here
//there could be a class here
}


I suggest reading that tutorial that tath posted.
Last edited on
Topic archived. No new replies allowed.