Which of the following is used to initialize the const members of the class using a constructor?

201. Which of the following is used to initialize the const members of the class using a constructor?

  1. Const constructor
  2. Default constructor
  3. Member initializer list
  4. Copy constructor

Answer: C) Member initializer list

Explanation:

In C++, a member initializer list is used to initialize the const members of the class.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.