34 lines
449 B
C
34 lines
449 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main ()
|
|
|
|
|
|
{
|
|
typedef struct
|
|
{
|
|
int life;
|
|
int magic;
|
|
}Vehicle;
|
|
|
|
typedef struct
|
|
{
|
|
Vehicle vehicle;
|
|
char brand[10];
|
|
}Car;
|
|
|
|
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", myCar.vehicle.life, myCar.vehicle.magic,
|
|
myCar.brand);
|
|
|
|
|
|
|
|
|
|
|
|
}
|