What does mean :: in c++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What does mean :: in c++?

a little question

31st Dec 2017, 9:33 AM
StopTim Studio
StopTim Studio - avatar
2 Answers
+ 4
It is used to access members inside a namespace namespace abc { int xzy; } void main() { std::cout<<abc::xyz<<std::endl; }
31st Dec 2017, 9:55 AM
romangraef
+ 4
It's a scope resolution operator it can also be used to access global variable when you have local variable also with the same name. Check below Url https://www.geeksforgeeks.org/scope-resolution-operator-in-c/
31st Dec 2017, 10:09 AM
Rishabh
Rishabh - avatar