Name: Anonymous 2012-12-31 14:02
If I allocate a block of memory, malloc() returns a pointer saved in variable x. I can set it free with free(x).
Now what if I don't know the pointer x anymore, but a pointer to an element within the allocated memory block - like &x[10] for example. Does free(&x[10]) do the same thing as free(x)? Or is possible to let it work that way?
Now what if I don't know the pointer x anymore, but a pointer to an element within the allocated memory block - like &x[10] for example. Does free(&x[10]) do the same thing as free(x)? Or is possible to let it work that way?