inherit: Added copying as template

This commit is contained in:
Logen Kain 2017-01-25 20:38:42 -07:00
parent bab718905d
commit defc028857

View File

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