Non-const functions _______________________

Sơn Lê

Member
Non-const functions _______________________
A. Can be called only from non-const object
B. Can be called only from const object
C. Can be called both by const and non-const object
D. Can’t be called with object
 
Answer: a
Explanation: The non-const functions are able to modify the values of object which called the function. So only the non-const functions can be called. If const object is used then the compiler produces an error as the const object is being given to a function which can modify its values.
 

Tìm kiếm

Back
Top