Challenge: Nested Structs
Task
Swipe to start coding
Practice defining and using nested structs to organize related data.
- Define a struct named
Addresswith a membercityof typestd::string. - Define a struct named
Companywith a memberaddressof typeAddress. - Write a function named
printCompanyCitythat takes aCompanyas a parameter and returns astd::stringwith the value of thecitymember in the format:Company city: <city>.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 2
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in simpler terms?
What are some examples related to this topic?
Where can I learn more about this?
Awesome!
Completion rate improved to 8.33
Challenge: Nested Structs
Swipe to show menu
Task
Swipe to start coding
Practice defining and using nested structs to organize related data.
- Define a struct named
Addresswith a membercityof typestd::string. - Define a struct named
Companywith a memberaddressof typeAddress. - Write a function named
printCompanyCitythat takes aCompanyas a parameter and returns astd::stringwith the value of thecitymember in the format:Company city: <city>.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 2
single