When dealing with classes, when is is appropriate to use the dot operator or the scope resolution operator ?
Scope resolution operator vs dot operator ?
Page 1 of 14 Replies - 1206 Views - Last Post: 29 March 2011 - 12:55 PM
Replies To: Scope resolution operator vs dot operator ?
#3
Re: Scope resolution operator vs dot operator ?
Posted 29 March 2011 - 07:40 AM
the scope resolution orperator is used to refer to members of a pointer object
#4
Re: Scope resolution operator vs dot operator ?
Posted 29 March 2011 - 12:33 PM
//Use of dot operator AClass a; //a is an instance of class AClass a.doSomething(); //Use of scope resolution operator AClass * b = &a; //b is a pointer of type AClass that points to the address of a b->doSomething();
#5
Re: Scope resolution operator vs dot operator ?
Posted 29 March 2011 - 12:55 PM
-> is NOT the scope resolution operator. It is the "pointer to member operator" or some such clumsy name.
The scope resolution operator is the double colon :: which as jimblumberg said is used to qualify names (to make explicit the scope or namespace in which they are defined).
The scope resolution operator is the double colon :: which as jimblumberg said is used to qualify names (to make explicit the scope or namespace in which they are defined).
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|