Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Nested Structs | Struct Usage
C++ Structures and Enumerations

bookChallenge: Nested Structs

Tehtävä

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

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 2
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 8.33

bookChallenge: Nested Structs

Pyyhkäise näyttääksesi valikon

Tehtävä

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

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 2
single

single

some-alt