What does it mean if namespace in C++ is qualified with ::
? For example ::testing::Test
.
I if you precede a variable name with ::, it resolves the variable to the global scope. In this way, you can have both a local variable testing and global variable testing and differentiate between them.
#include
using namespace std;
int testing = 37;
int main()
{
int testing = 42;
cout << ::testing << ' ' << testing << endl;
}
Output will be 37 42