Next:
Exceptions
Up:
Basic class semantics
Previous:
Data access privileges
Contents
Namespaces
All C++ symbols (variable names, function names, class names) exist within a
namespace
The complete symbol is
namespaceName::symbolName
The only pre-defined namespace is the
global namespace
(its name is the empty string
::varName
)
Standard C++ library: namespace
std
std::string
namespace WET {
const int maxBufSize = 1024;
const char charCloseTag = '>';
}
char buffer[WET::maxBufSize];
using namespace WET;
for(int i = 0; i < maxBufSize - 1; i++) {
buffer[i] = charCloseTag;
}
Leo Liberti 2008-01-12