inherit: Added Second Car
This commit is contained in:
parent
301d91a371
commit
bab718905d
@ -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);
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user