Now I wan't to test if the exception works. i tried making a ridiculous amount of stack elements, but the program died with the words "Killed" (translated from swedish), and then the computer was really funky.
So, how can I test this without messing up the whole system?
One possible thing to do is to add a try-catch block in main around your entire program and catch
the std::bad_alloc there. At that point, you have to make sure the rest of your program is
completely exception safe, and hope that enough memory got freed by stack unwinding and
running destructors that you can now output your message.