char* str = "something";
If you try to delete str you will get exception at _CrtIsValidHeapPointer.
The thing is that you can not dealoce str because you didn't alocated it at all.
And don't wory. You will not get memory leaks. This string is already in memory. When this command is executed str just get pointer to that part of memory.
Compile program, open it (.exe) in some hex editor and search for "something". It's there :))))
No comments:
Post a Comment