What does the scope resolution operator '::' do in c++? Why do we have to use it while declaring the function outside the class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does the scope resolution operator '::' do in c++? Why do we have to use it while declaring the function outside the class?

'::' scope resolution operator in c++

21st Jul 2019, 7:41 AM
Merlyn J
1 Answer
+ 1
The :: (scope resolution)Ā operatorĀ is used to get hidden names due to variable scopes so that you can still use them. TheĀ scope resolution operatorĀ can be used as both unary and binary. from: tutorialspoint.com In other words, with this operator you are pointing to the source of that function.
21st Jul 2019, 9:50 AM
mhb