Scope resolution operator..used just to define functions member of a class ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Scope resolution operator..used just to define functions member of a class ?

Scope resolution operator..used just to define functions member of a class ?..in case of a friend function,we don't use it...so the friend function is not a member of the class ?

1st May 2017, 5:03 PM
De Vinci
4 Answers
1st May 2017, 5:12 PM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 1
Accessing static functions perhaps, everything else is a member access operator (dot/arrow).
2nd May 2017, 8:33 PM
Norbivar
Norbivar - avatar
- 1
Or to resolve the scope (namespace/class) the function is in. Like std::* things.
1st May 2017, 5:16 PM
Norbivar
Norbivar - avatar
- 1
More like; used to access member functions of a class. That's why it doesn't need to be used in friend functions (because, friend functions aren't inside the class). Besides, the only time you wouldn't need it for a friend function is if the friend function is within the reach (or scope) of your current call.
2nd May 2017, 11:43 AM
Bennet
Bennet - avatar