I know that ::
is the scope resolution operator. However what does it mean if something simply starts with a scope resolution operator. I know that something needs to be placed before the scope resolution operator (either a class name or a namespace). What if there is nothing before a scope resolution operator. For instance ::Method()
It refers to the global scope. For example:
int count = 0;
int main(void) {
int count = 0;
::count = 1; // set global count to 1
count = 2; // set local count to 2
return 0;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With