Dereference void pointer

printf("\nlVptr[60 ] is %d \n", *(int*)lVptr);

This will cast the void pointer to a pointer to an int and then dereference it correctly.

If you want to treat it as an array (of one), you could do a slightly ugly ((int *)lVptr)[0]. Using [1] is out of bounds, and therefore not a good idea (as for lVptr[60]…)

Leave a Comment