Sectionย 2. Chapterย 2
single
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
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat