If a friend overloaded operator have to be changed to member overloaded operator, which operator should be used with the class name?

Thu Ha

New member
If a friend overloaded operator have to be changed to member overloaded operator, which operator should be used with the class name?
A. Scope resolution operator
B. Colon
C. Arrow operator
D. Dot operator
 
Answer: a
Explanation: The scope resolution operator can be used followed by the class name. Then the operator keyword with the operator symbol that should be overloaded. This is done to use member function instead of friend function.
 

Tìm kiếm

Back
Top