Throwing an exception and its messages

I am new to using CLion and will try to write a simple program to understand how it works. I am on Windows 8 + cygwin , the program:

 int main() { throw std::exception(); } 

I got the output in the console:

 C:\....\bin.exe Process finished with exit code 0 

Where were program messages interrupted or something else? There was nothing, and how should I determine if my program was really interrupted by throwing an exception?

+5
source share
1 answer

This is because you have no attempt and trick, and it happens something like stack unwitted.in, if you do not have a catch, it goes down the stack until it reaches the main one, and if the catch is not completed .if your function throws an exception, without catching it, it immediately terminates, and you return to the function of the caller. The caller function is Main and you have no catch. The terminate.it program goes down. A stack and without a catch somewhere in this chain of functions completes the program.

+1
source

All Articles