here is the code
struct point_tag {
int x;
int y;
};
typedef struct point_tag Point;
int main(void)
{
Point pt[] = { {10,20}, {30, 40}, {50,60}};
pt[0] = {100,200};
}
When i do pt[0] = {100, 200}, the compiler keeps complaining of
error:expected expression before '{' token
I don't really get that though. Isn't the expression before the { token assignment operator(=)?
I don't understand why the assignment would be an issue though. the value at address pt refers to an array of Point. I am just setting the 0th Point to be this new point and i know that assigning a struct in a format like {100,200} is legal where the elements inside that array are just fields.