:: operator

 

Hi i have a question about space resolution operator:  ::

in this line   if(! symbol!=::Symbol() )    why it used ::  operator.

it means if symbol is different from current symbol on chart do something.

but why puts  :: over there?

thanks for your help.

 
Because the code may include a custom Symbol() function.
 
Alain Verleyen:
Because the code may include a custom Symbol() function.

Hi

i didn't understand

could you please explain it more

thanks

 
ahmadasadi1342103:

Hi

i didn't understand

could you please explain it more

thanks

No.
 
class C{
  C(){ string s=Symbol(); }
  string Symbol(){ return "junk"; }
};

In the above case, the constructor calls the class's method.

If it wanted to call the terminal's Symbol() instead, it would need to use:
string s=::Symbol();