English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

in c++, while implementing inheritance, scope resolution operator i.e. '::' is used to specify the visibilty mode of derived class.is there any replacement for this operator?(maybe some other operator or something else).if yes,then wat is the replacement?

2007-02-05 03:42:27 · 5 answers · asked by Saniya 1 in Computers & Internet Programming & Design

5 answers

Scope resolution operator "::" cannot be overloaded because it is a base address resolution operator. in C++, while implementing inheritance, redefinition of function is possible instead of using scope resolution operator.

2007-02-05 15:31:20 · answer #1 · answered by Rishi 3 · 0 0

There is no replacement for a scope resolution operation. The member functions and variables can be accessed using a class objective pointer but a scope resolution is needed to specify the relation between function of a class with other functions and classes.

2007-02-05 04:01:43 · answer #2 · answered by sharma p 4 · 0 0

The scope resolution operator when used as a prefix to a variable name will look for the most globally-scoped variable with that identifier. Without it, the variable name refers to the most locally-scoped variable in its environment. There is no syntactic way to specifically refer to a variable that is neither both global or entirely local to the scope from which it is accessed. The only thing I can think of is printing out the variable before you create the new one inside the inner brackets.

2016-05-24 18:16:39 · answer #3 · answered by Anonymous · 0 0

I dont think any other operator is there to replace scope resolution operator.
In worst case, if u really any alternative, then u can overload any operator so that it function same as ' :: '. But this is never recommed option.

2007-02-05 03:51:33 · answer #4 · answered by Adil M 2 · 0 0

just by using an accessed member at the end of class definition

2007-02-05 04:03:30 · answer #5 · answered by vignesh n 2 · 0 0

fedest.com, questions and answers