Code:
#include <stdio.h>
#include <string.h>
void main()
{
struct oz
{
char actor[30];
char character[30];
int age;
}; <------------------ you forgot to terminate your struct definition with a semicolon
struct oz actor[4];
int x;
strcpy(actor[0].actor,"Judy Garland");
strcpy(actor[0].character,"Dorothy");
actor[0].age=17;
strcpy(actor[1].actor,"Ray Bolger");
strcpy(actor[1].character,"Scarecrow");
actor[1].age=35;
strcpy(actor[2].actor,"Bert Lahr");
strcpy(actor[2].character,"Cowardly Lion");
actor[2].age = 44;
strcpy(actor[3].actor,"Jack Haley");
strcpy(actor[3].character,"Tin Woodsman");
actor[3].age = 40;
puts("Wizard of Oz Database!");
for(x=0;x<4;x++)
{
printf("%s played %s, and was %i years old.\n",actor[x].actor, actor[x].character, actor[x].age);
}
}
whenever i compile this, it says ''two or more data types in declaration of 'actor''
what does this mean? id appreciate if anyone can help.