2 ms·
Then std::atoi() would be making the assumption that you want to handle the error as soon as the function call returns. Furthermore, if you don't check the "su
by Suncho 9y ago
Then std::atoi() would be making the assumption that you want to handle the error as soon as the function call returns.
Furthermore, if you don't check the "success" flag, then your function would fail silently. The exception ensures that something reasonable happens (program termination) when the client does nothing to handle the error.
Exceptions are cleaner.