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

Kursusindhold

C++ OOP

C++ OOP

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

book
Initialization List Practice

Opgave

Swipe to start coding

  • 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.

Løsning

cpp

solution

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 4
toggle bottom row

book
Initialization List Practice

Opgave

Swipe to start coding

  • 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.

Løsning

cpp

solution

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 4
Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Vi beklager, at noget gik galt. Hvad skete der?
some-alt