What I am doing wrong here for C99:
struct chess {
struct coordinate {
char piece;
int alive;
} pos[3];
}table[3] =
{
{
{'Q', (int)1},{'Q', (int)1},{'Q', (int)1},
{'B', (int)1},{'B', (int)1},{'B', (int)1},
{'K', (int)1},{'K', (int)1},{'K', (int)1},
}
};
It gives the error:
error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token
I wish to be able to access the data like having a struct within a struct that:
table[row].pos[column].piece
table[row].pos[column].alive
I tried several combinations, and none seems to work for this case. I have done previous struct hard coded initialization before that works, but not a struct within a struct as this time.
Any suggestions?