1. Home
  2. Computer Science MCQs
  3. C++ and Object-Oriented Programming
  4. What does a trailing const on a member function mean?

Added 30 Nov -0001

What does a trailing const on a member function mean?

  1. It must be evaluated at compile time
  2. It promises not to modify the object Correct answer
  3. It returns a constant value
  4. It can be called only one time

Correct answer

B. It promises not to modify the object

14 views

MCQSEXAM

Explanation

A const member function receives a const this pointer, so it cannot modify the object's data members.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C++ and Object-Oriented Programming MCQs

Practise all C++ and Object-Oriented Programming MCQs

Similar MCQs