Scope Resolution Operator

From RAD Studio
Jump to: navigation, search

Go Up to C++ Specifics Index


The scope access (or resolution) operator :: (two colons) lets you access a global (or file duration) member name even if it is hidden by a local redeclaration of that name.

  • You can use a global identifier by prefixing it with the scope resolution operator.
  • You can access a nested member name by specifying the class name and using the scope resolution operator.

Therefore, the following two functions are different:

Alpha::func( ) 
Beta::func( ) 

See Also