+ 1

what is use of catch and throw in c++

10th Aug 2016, 12:41 PM
Aman gautam
Aman gautam - avatar
2 Answers
+ 1
I've been taught to use it for error handling. You put 'try' before a block of code and then 'catch' with the error or condition at the end of the code you want to "test".
10th Aug 2016, 11:33 PM
Donovan
Donovan - avatar
+ 1
Those keywords are for exception handling function , if you don't catch the exception your program simply crashes
11th Aug 2016, 2:37 PM
Hicham Mine
Hicham Mine - avatar