0
What is scope resolution in c ++?
Can we have scope resolution in c?
4 Antworten
+ 8
Scope resolution( : : ) is special type if operator by which we can use global variable over local variable or it can be used to access public class member function outside the class.
i.e.
#include<iostream>
int a = 10;
int main(){
int a = 20;
cout << "local a- " << a;
cout << "global a- " << ::a;
}
+ 1
yes the "::" is an operator and is present in most of languages like C, C++, Java, etc....
and it has very simple meaning the variable after "::" has its scope defined in the upper compound block
or it can be used to access the functions of a class(not objects) since you cannot directly access the functions because they are just like blueprints...I.e., non existent
ask if you aren't satisfied
+ 1
" -> " is used to point objects
0
Speakink of operators in oop, what's the meaning of -> operator?