In the solution code, what does this mean( ::B=B ) ??
And I submitted without it and the code still got submitted.
So please tell me the use of this in cp!!
Syntax doubt, Pl clear
:: is scope resolution operator
in ur case it is used:
To access a global variable when there is a local variable with same name:
int x; // Global x
int main()
{
int x = 10; // Local x
cout << "Value of global x is " << ::x; -> 0
cout << "\nValue of local x is " << x; _>10
return 0;
}
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.