Ignoring programming style and design, is it \"safe\" to call delete on a variable allocated on the stack?
For example:
int nAmount; delete &am
Well, let's try it:
jeremy@jeremy-desktop:~$ echo 'main() { int a; delete &a; }' > test.cpp jeremy@jeremy-desktop:~$ g++ -o test test.cpp jeremy@jeremy-desktop:~$ ./test Segmentation fault
So apparently it is not safe at all.