In the course of asking about catching 'divide by 0' exception, I found that with C++, we can't do that. I mean, divide by 0 doesn't throw an std::exception.
Some of the hints that I found were I have to check the value, and throw the exception by self.
I say it's confusing, as I've thought that C++ adopted the exception idea in order to replace the 'good old C/UNIX report error by returning value method'.
Here are my questions
- Q1 : Why C++ doesn't throw std::exception error for divide by 0? Is there any reason behind that?
- Q2 : Normally, what error processing scheme the C++ users use? Always throw an error, and the exception is the divide by 0 error?
- Q3 : In general, OOP languages prefer (or even enforce) using exception. Is this correct?