Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Initialization List Practice | Constructors and Destructors
C++ OOP
course content

Course Content

C++ OOP

C++ OOP

1. Fundamentals of OOP
2. Constructors and Destructors
3. Encapsulation Overview
4. Inheritance Overview
5. Polymorphism Overview

bookInitialization List Practice

Task
test

Swipe to show code editor

  • Rewrite constructor using the initialization list instead of assignment statements in the constructor body.
  • Ensure that the order of initialization matches the order of declaration for the class member variables.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 4
toggle bottom row

bookInitialization List Practice

Task
test

Swipe to show code editor

  • Rewrite constructor using the initialization list instead of assignment statements in the constructor body.
  • Ensure that the order of initialization matches the order of declaration for the class member variables.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 4
toggle bottom row

bookInitialization List Practice

Task
test

Swipe to show code editor

  • Rewrite constructor using the initialization list instead of assignment statements in the constructor body.
  • Ensure that the order of initialization matches the order of declaration for the class member variables.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Task
test

Swipe to show code editor

  • Rewrite constructor using the initialization list instead of assignment statements in the constructor body.
  • Ensure that the order of initialization matches the order of declaration for the class member variables.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 2. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt