+ 15
Working of Scope Resolution Operator( : : )?
6 odpowiedzi
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
+ 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
0
printf() is in C. C++ use cout . Printf wold be compiled by C++ compiler, but avoid this as you can.
- 1
Why don't(can't) we learn print f in this app?
- 1
ok
- 1
I am new here