diff --git a/inherit/main.c b/inherit/main.c index 32b7a0f..9fce1aa 100644 --- a/inherit/main.c +++ b/inherit/main.c @@ -2,6 +2,8 @@ #include int main () + + { typedef struct { @@ -15,18 +17,17 @@ int main () char brand[10]; }Car; - Car ford; - ford.vehicle.life = 5; - ford.vehicle.magic = 9; - strcpy(ford.brand, "Ford"); + Car myCar; + myCar.vehicle.life = 5; + 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", ford.vehicle.life, ford.vehicle.magic, - ford.brand); + "The car's brand is: %s\n", myCar.vehicle.life, myCar.vehicle.magic, + myCar.brand); - //code }