Take the following code :
int *p = malloc(2 * sizeof *p); p[0] = 10; //Using the two spaces I p[1] = 20; //allocated with malloc before. p[2] = 30; //U
Do :
int *p = malloc(2 * sizeof(*p)); // wrong (if type is something greater than a machine word) [type] *p = malloc(2 * sizeof([type])); // right.