Handling try catch. What are you doing wrong?

Can't catch exception and accordingly, debajit program in C++...

try {
 int a = 1, b = 0;
 int c = a / b; // in this case mimic exception for example
}
 catch (...) {
 int a = 1;
 }


I used to catch put a breakpoint and was able to catch the exception. Why now does not work. It might be the IDE settings? I Use Visual Studio 2013
July 9th 19 at 10:23
3 answers
July 9th 19 at 10:25
division by 0 is not an exception, and iron levels. It is impossible to intercept, can be processed by connecting csignal header file, and you specify a handler for SIGFPE.
Specifically, the Studio might have your bike to intercept such errors and convert into an exception, but where configure will not prompt, it may be worthwhile to dig around in the Debug->Exceptions
Free_ze, thanks for the link, helped here it is: stackoverflow.com/a/8226455/3909255 - chelsey_Schmidt commented on July 9th 19 at 10:31
Nowhere plyusanut : - mercedes commented on July 9th 19 at 10:34
July 9th 19 at 10:27
And exactly what type of exception you catch?
Judging by the code, it catches all exceptions - Elna.Volkman92 commented on July 9th 19 at 10:30
The idea is if you catch(...), then it's all exceptions - chelsey_Schmidt commented on July 9th 19 at 10:33
: sorry:) the pros know is bad, more sharp, I thought that just the man lowered this point, and not pointed. - mercedes commented on July 9th 19 at 10:36
: Google the subject, there are enough differences from sierpe. - orin.Runte commented on July 9th 19 at 10:39
July 9th 19 at 10:29
Perhaps the optimizer threw a code that does nothing.

write in the exception handler, something with a side effect like cout << "FAULT!" << endl;
But it's not quite logical, if eksepsi is not extinguished. - Elna.Volkman92 commented on July 9th 19 at 10:32
If tossed to the trash, then we would have an empty catch(...) {} - just exit the program. And I have freezes in try {} - chelsey_Schmidt commented on July 9th 19 at 10:35
: the fact that you have freezes - it would be nice to add in description of the question, because it seems that you have the exception is unhandled. - mercedes commented on July 9th 19 at 10:38

Find more questions by tags C++