here, i'll give the first one,
To use the global scope, you need to prefix the variable name with
the scope resolution operator (: and to use the local scope, you do
not need to do anything to the variable name since by default, the
scope is the local scope.
int amount = 123; // global variable
int amount = 456; // local variable
cout << ::amount << endl; // Print the global variable (123)
cout << amount << endl; // Print the local variable (456)
thanks, i'm trying to collect neat C/C++ tricks and then somehow make a website for this,
pls post only those that are hard to find, rare, not in books etc., and pls do not forget to provide a short description, thanks!