p is a pointer, not a structure, so it works like pointer arithmetic on any type. The pointer value is the address. Therefore, when, for example, you add n to the pointer, it changes the value and points to the new address n * sizeof type . So that...
char *p = malloc(SOME_NUMBER * sizeof char); p++;
And if you have a structure ...
typedef struct { int a; } foo; foo *fp = malloc(SOME_NUMBER * sizeof foo); fp++;
source share