M
mahesh_cbrl
Hi,
I am unable to intialize an array of structures and I keep getting an
error. Here is how the data structure looks like.
typedef struct
{
struct
{
int part_no;
char item_name[65];
}ItemList[10];
}MACHINE;
I also have an array of two elements each of which is of type MACHINE.
MACHINE category[2];
I want to initialise all the 10 elements of array ItemList for each
category as follows:
category[0].ItemList[] =
{
{2001, "SIDEBOLT"},
{2001, "DRILLBIT"},
--------
--------
};
When I try to initialize like the above, I get an error saying that
"parse error before ]".
What am I doing wrong and how do I correct this?
Thanks
Cheb.
I am unable to intialize an array of structures and I keep getting an
error. Here is how the data structure looks like.
typedef struct
{
struct
{
int part_no;
char item_name[65];
}ItemList[10];
}MACHINE;
I also have an array of two elements each of which is of type MACHINE.
MACHINE category[2];
I want to initialise all the 10 elements of array ItemList for each
category as follows:
category[0].ItemList[] =
{
{2001, "SIDEBOLT"},
{2001, "DRILLBIT"},
--------
--------
};
When I try to initialize like the above, I get an error saying that
"parse error before ]".
What am I doing wrong and how do I correct this?
Thanks
Cheb.