-
Name spaces in C++
Hi all,
I am writting an application in Visual C++ and am having troubles linking the front end modules with the back end ones.
Im getting hundreds of link errors and suspect its due to
class/variable nameing conflicts.
Someone suggested i use a feature called "name sapceing" but i cant find much info about it.
Does anyone know how to use it and how data is shared using name spaceing.
Any help would be much appreciated.
Captain Fish.
-
Code:
namespace MyNames{
int aVar = 10;
// or any other stuff here (classes, functions, ...)
}
// In other source file you can use the namespace like this:
cout << MyNames::aVar;
// ----- or -----
using MyNames::aVar;
cout << aVar;
This is just a quick example. Please ask for more information if something is unclear.