What is the different between these two?
cpp-file:
namespace { int var; }
or
int var;
if both
In the second case other .cpp files can access the variable as:
.cpp
extern int var; var = 42;
and the linker will find it. In the first case the variable name is mangled beyond any reason :) so the above is not possible.