Will the free() routine work if I dynamically allocate an array and then pass, not the initial pointer, but a pointer to the middle of the array? Example:
free()
(And "Yes", you do need to "set it back".)
The API requires that you only pass to free() exactly what you got from malloc()1.
malloc
1. Or a null pointer.