Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Nested Structs | Struct Usage
Quizzes & Challenges
Quizzes
Challenges
/
C++ Structures and Enumerations

bookChallenge: Nested Structs

Oppgave

Swipe to start coding

Practice defining and using nested structs to organize related data.

  • Define a struct named Address with a member city of type std::string.
  • Define a struct named Company with a member address of type Address.
  • Write a function named printCompanyCity that takes a Company as a parameter and returns a std::string with the value of the city member in the format: Company city: <city>.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 2
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

Awesome!

Completion rate improved to 8.33

bookChallenge: Nested Structs

Sveip for å vise menyen

Oppgave

Swipe to start coding

Practice defining and using nested structs to organize related data.

  • Define a struct named Address with a member city of type std::string.
  • Define a struct named Company with a member address of type Address.
  • Write a function named printCompanyCity that takes a Company as a parameter and returns a std::string with the value of the city member in the format: Company city: <city>.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 2
single

single

some-alt