I'm new to using CLion
and try to write a simple program to understand how it works. I'm on Windows 8 + cygwin
the program is:
int main()
{
throw std::exception();
}
I got in the console the output:
C:\....\bin.exe
Process finished with exit code 0
Where the messages about the program was aborted or something else? There was nothing, and how should I detect if my program was actually aborted by throwing exception?
This is done because you don't have try and catch and it happens something like stack unwitted.in a function if you don't have catch it goes down the stack until it reaches main and if there is no catch is terminate.if your function throw an exception without catch it terminate imediately and you go back to The caller function.if The caller function is Main and you don't have catch The program terminate.it goes down The stack and without a catch somewhere in this chain of functions it will terminate The program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With