Warning: pointer of type 'void *' used in subtraction
- by idealistikz
Although it runs correctly, the following results in the aforementioned compiler warning:
return ((item - (my->items))/(my->itemSize));
'item' is a 'void *'; 'my-items' is a 'void *'; 'my-itemSize' is an 'int'
Casting 'item' and 'my-items' as an 'int *' caused the program to run improperly. What is the best way to remove the warning?