c - Assigning values to pointers? -
in dennis ritchie found this,
struct rect r , *rp = r; then these 4 expressions equivalent :
r.pt1.xrp->pt1.x(r.pt1).x(rp->pt1).x
because operators associate left right.
shouldn't struct rect *rp = &r?
absolutely -- address operator required, otherwise compile-time error:
incompatible types when initializing type ‘struct rect *’ using type ‘struct rect’
Comments
Post a Comment