+ 2
Runtime_error program
How could I make a program that implements runtime_error? I’m confused as to how to make one that the constructor takes in a input string and displays it.
5 ответов
+ 1
If I understand what you’re asking correctly, the answer is in the C++ tutorial under exceptions. Handle exceptions using the keywords try, throw, and catch
+ 1
it doesnt mention runtime error in it
+ 1
https://www.sololearn.com/discuss/558877/?ref=app
You can use exception handling for runtime errors, such as dividing by zero
+ 1
so i could use this in main to do a try, catch, throw for say, division?
https://code.sololearn.com/cTdtt8U8j5nw/?ref=app
+ 1
I’m not proficient in C or C++, but from what I can read, it might work. The only way to know for sure is to test it out though