inherit: Added Second Car

This commit is contained in:
Logen Kain 2017-01-25 20:35:49 -07:00
parent 301d91a371
commit bab718905d

View File

@ -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);