Is global scope means declaring something outside the main function?? If not then when why do we need to use “Scope resolution operator” to access the variable in local scope??
Doubt in Global Scope
Global variables are defined outside of all the functions, usually on top of the program. The global variables will hold their value throughout the lifetime of your program. A global variable can be accessed by any function.
Refer this https://www.geeksforgeeks.org/scope-resolution-operator-in-c/ for the use case of scope resolution operator.
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.