Why can I do:
int i = *(new int (5));
and successfully use iafter it,
but when I try:
delete &i;
I get a runtime error:
Unhandled exception in 0x5ddccaf7 (msvcr100d.dll) in Test.exe: 0xC00000FD: stack overflow.
If there iwas a link:
int & i = *(new int (5));
all of this (including delete) works great.
I know that it is not good to keep a dedicated memory handler in anything but a pointer, and *(new ...)horrible, but I just wonder why it newworks well, but deletefails.
// Below are just my guesses about the reason for this behavior:
, , (, , "", - , ), delete, , &i ( - ) ? ( , , )