E
esclepius
In the following little bit of code, I understand what and why the
error is, ( lack of parentheses in *pp.y , thus declaring 'y' a
pointer, which it is not) but what I don't get is the error the
compiler raises.
int main (int argc, const char * argv[]) {
struct point {
int x;
int y;
};
struct point origin;
struct point *pp;
pp= &origin;
origin = makepoint(23, 67);
printf("%d, %d\n", (*pp).x, *pp.y); /*error: request for member 'y'
in something not a structure or union */
}
I am sure I will get this again at some point, so any logic here is
appreciated, or perhaps I am looking too deeply.
Thanks.
error is, ( lack of parentheses in *pp.y , thus declaring 'y' a
pointer, which it is not) but what I don't get is the error the
compiler raises.
int main (int argc, const char * argv[]) {
struct point {
int x;
int y;
};
struct point origin;
struct point *pp;
pp= &origin;
origin = makepoint(23, 67);
printf("%d, %d\n", (*pp).x, *pp.y); /*error: request for member 'y'
in something not a structure or union */
}
I am sure I will get this again at some point, so any logic here is
appreciated, or perhaps I am looking too deeply.
Thanks.