How are arrays of structures accessed using pointer arithmetic?
suppose I have a struct
struct point{
int x;
int y;
}collection[100];
Suppose I have a function
int func(struct point *collection,int size)
Inside this function I access the element as shown below.
collection[0].x
Is this the same as *(collection + 0).x? Since the . operator has higher precedence than the * operator, first the collection pointer is incremented by 0, and the the dot operator is applied, and then the pointer dereferenced? Somehow this does not make sense; any clarification is appreciated.
0[collection].xis?