From bab718905dd38a1779d4ac7b74c33863d955b1c2 Mon Sep 17 00:00:00 2001 From: Logen Kain Date: Wed, 25 Jan 2017 20:35:49 -0700 Subject: [PATCH] inherit: Added Second Car --- inherit/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/inherit/main.c b/inherit/main.c index 9fce1aa..2b3fd13 100644 --- a/inherit/main.c +++ b/inherit/main.c @@ -22,11 +22,17 @@ int main () myCar.vehicle.magic = 9; strcpy(myCar.brand, "Dodge"); - printf("The car's life is: %d\n" "The car's magic is: %d\n" - "The car's brand is: %s\n", myCar.vehicle.life, myCar.vehicle.magic, + printf("My car's life is: %d\n" "My car's magic is: %d\n" + "My car's brand is: %s\n\n", myCar.vehicle.life, myCar.vehicle.magic, myCar.brand); + Car herCar; + herCar.vehicle.life = 8; + herCar.vehicle.magic = 5; + 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, + herCar.brand);