I'm working on a problem that uses a nested structure, and i have this portion of code that's giving me a problem. I have NO idea what the heck is wrong with it...
Code:
struct person {
char fname[50];
char mname[50];
char lname[50];
};
struct ssinfo {
char ssnum[10];
struct person name;
};
void printssinfo(struct ssinfo peoples);
int main(void)
{
struct ssinfo people[5] = {
{"123456789"}, {"E", "D", "D"},
{"123456789"}, {"E", "D", "D"},
{"123456789"}, {"E", "D", "D"}, /* HERE */
{"123456789"}, {"E", "D", "D"},
{"123456789"}, {"E", "D", "D"}
};
... print stuff then return 0;
}
right where it says "HERE" it gives me this error: [Warning] excess elements in array initializer
when i set the people array to [10] instead of [5] it doesn't give me ANY errors but i know that's wrong... any ideas? what have I done wrong?