I want to free last 3 bytes of 4 byte allocated data (the data is not an array it is one single integer)

Viewed 115

I am using realloc function for this purpose but it is not certainly returning the same memory address as my first allocated location.

void *vp1 = realloc(vp, 1);

I want vp1 is always equal to vp.

Edit:

I am actually trying to flag my destroyed objects with using their first byte, and free rest of the memory.

3 Answers
Related