Initialization List Practice
Task
Swipe to start coding
You are working with a class that requires proper initialization of its member variables.
- Rewrite the constructor using an initialization list instead of assigning values inside the constructor body.
- Make sure the initialization order follows the order in which the member variables are declared in the class.
Solution
solution.cpp
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Summarize this chapter
Explain the code in file
Explain why file doesn't solve the task
Awesome!
Completion rate improved to 3.13
Initialization List Practice
Swipe to show menu
Task
Swipe to start coding
You are working with a class that requires proper initialization of its member variables.
- Rewrite the constructor using an initialization list instead of assigning values inside the constructor body.
- Make sure the initialization order follows the order in which the member variables are declared in the class.
Solution
solution.cpp
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 3.13SectionΒ 2. ChapterΒ 4
single