diff --git a/inherit/main.c b/inherit/main.c index 2b3fd13..b794429 100644 --- a/inherit/main.c +++ b/inherit/main.c @@ -4,6 +4,7 @@ int main () + { typedef struct { @@ -31,9 +32,15 @@ int main () strcpy(herCar.brand, "Saturn"); printf("Her car's life is: %d\n" "Her car's magic is: %d\n" - "Her car's brand is: %s\n", herCar.vehicle.life, herCar.vehicle.magic, + "Her car's brand is: %s\n\n", herCar.vehicle.life, herCar.vehicle.magic, herCar.brand); + Car herCar2 = herCar; + + printf("Copy of HerCar\n" "Her car's life is: %d\n" "Her car's magic is: %d\n" + "Her car's brand is: %s\n", herCar2.vehicle.life, herCar2.vehicle.magic, + herCar2.brand); + }