Working of Scope Resolution Operator( : : )? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 15

Working of Scope Resolution Operator( : : )?

11th Apr 2019, 4:02 PM
Prachi Chauhan
Prachi Chauhan - avatar
6 Answers
0
Any varible has its own scope. for example... int x = 3; //global scope int numberX () { int x = 10; return x; } //scope of this function class NummerX { private: int x = 666; //scope of the class public: getX() { return x} } .... In the main() , you could call all 'x' variable unumbigously beacause each 'x' is applied in a scope. the operator :: changes the scope in question... Have you got? scope means +-: for each 'x' the compiler pick up the more suitible according to the context
13th Apr 2019, 9:44 AM
Daniel Bandeira
Daniel Bandeira - avatar
+ 5
I didn't get your question. Can you clarify it more. For now I got this for you https://www.tutorialspoint.com/Scope-resolution-operator-in-Cplusplus
11th Apr 2019, 4:09 PM
Seniru
Seniru - avatar
0
printf() is in C. C++ use cout . Printf wold be compiled by C++ compiler, but avoid this as you can.
14th Apr 2019, 2:13 PM
Daniel Bandeira
Daniel Bandeira - avatar
- 1
Why don't(can't) we learn print f in this app?
14th Apr 2019, 2:04 PM
Gaming hacker01
Gaming hacker01 - avatar
- 1
ok
14th Apr 2019, 2:14 PM
Gaming hacker01
Gaming hacker01 - avatar
- 1
I am new here
30th Apr 2019, 10:13 AM
Shavkat Turakulov