Hello friends, in this post today, we will learn about What is scope resolution operator in c++ and how to use in our program. so let's start....
Scope resolution operator |
Scope resolution operator :-
Scope resolution operator which is also known as (membership lable), represnted as (::).
The scope resolution operator is employed to resolve or extend the scope of variable or functions.
C++ is block structured language. We know that the same variable or function name can be used to have different meaning in different block.
The scope resolution operator will refer value of worldwide variable or function from anywhere (also from inner block).
Without scope resolution operator all variable will refer local value.
Example for variabe:
Output:
Example for function:
Output:
I hope that whatever information I have given in this post today, you have liked it and you have understood it.so keep learning and wait for the next post that will help you to increase your knowledge with the something new information.
Thank you so much for reading. And take care about yourself and your family.
Comments
Post a Comment