I have a problem about (exceptions in C++). I have been searching for a (long time) to find final solution for this problem; but still I could not find any thing. I have read all answers but no benefit. I tried in C++ Xcode & C++ Borland ! why (try & catch) block does not work ? Please I want to catch dividing by zero; how can I ? thanks...
Asked
Active
Viewed 25 times
0
-
Division by zero isn't required to raise an exception. Your whole premise is wrong. – StoryTeller - Unslander Monica Mar 05 '18 at 20:32
-
@StoryTeller true in general, however in some Borland environments, they do intercept OS errors like divide-by-zero and convert them into normal C++ exceptions which can be caught. But this is handled at the RTL level, not the language level, and should not be relied on in portable code. – Remy Lebeau Mar 10 '18 at 23:24