21⟩ A const object of a class can call non-const member function of the class. a. True b. False
b. False
“C++ access control job preparation guide for freshers and experienced candidates. Number of C++ Access Control frequently asked questions(FAQs) asked in many interviews”
b. False
a. True
a. Yes
a. Yes
b. False
a. True
b. False
Default values need to be specified from Right to Left order.
Example:
void calculate(int amt, int years, float rate=7.8); //valid
void calculate(int amt, int years=5, float rate=7.8); //valid
void calculate(int amt=21000, int years, float rate=7.8); //Invalid
Third statement is invalid as we skipped second parameter of the function. Rule says that default values should be set from Right to Left order only. We cannot provide a default value to
specific parameter in the middle of an parameter list.
b. False
b. False
b. Run time
c. Only 2,3,5