weird pointer issue

This is a discussion on weird pointer issue within the C++ Programming forums, part of the General Programming Boards category; Hey everyone,
I haven't programmed in quite some time and was trying to get back into it. So I wrote ...

Chaplin> Random question, is it possible to call delete on a modified pointer like this?

A better question is "how does delete/free() know how much memory to free when being called with a pointer?"
Think about it.

...A pretty common implementation is to also allocate some space just before the pointer, and there store the size of memory being allocated. That way, when delete or free() is being called they just move back and find the size of the chunk to free.