why does this not work
i get the error initialize1.c:13: error: two or more data types in
declaration of `mysale'
example below taken from book, "it says in the book"
For a structure that contains structures as members, list the initialisation
values in order. They are placed in the structure members in the order in
which the members are listed in the structure definition. Here's an example
to explain it
/* INITIALIZE1.C */
#include<stdio.h>
struct customer{
char firm[20];
char contact[25];
}
struct sale{
struct customer buyer;
char item[20];
float amount;
}mysale = { {"acme Industries", "George Adams"}, /* line 13 */
"left_hand widget",
1000.00
};
int main(void) /* this bit add by me just to see it work */
{
printf("%s\n%s\n",mysale.buyer.firm,mysale.buyer.c ontact);
printf("%s\n%f\n",mysale.item, mysale.amount);
return 0;
}