svh
1
hello,
i have a structure defined as follows
struct Image
{
int lenght;
int height;
};
and i have another structure where i declare a array of the above structure
struct ShapeImage
{
Image image[10];
};
when i compile this code with gcc it shows me the following error :
"syntax error before `[' token"
plz help me how should i proceed for this.
thanx in advance
svh
vino
2
You didnt typedef image. I dont think you can use image just like that.
You will need to declare the array as
struct Image image[10];
Else
typedef struct
{
int lenght;
int height;
} Image;
struct ShapeImage
{
Image image[10];
};
svh
3
hello,
thanx for replying.
i did the same thing as u said.
but then too its showing the same message.
any other way out.
svh
else you could do it this way,
struct Image
{
int lenght;
int height;
} ;
struct ShapeImage
{
struct Image image[10];
};
i dont think the problem is due to this,
could you please post ur code and the error message that you are receiving?