In C++ if a function or a nested try-block does not want to handle an exception, it can rethrow that exception to the function or the outer try-block to handle that exception. Syntax for rethrowing and exception is as follows: throw; Following program demonstrates rethrowing and exception to outer try-catch block: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 #include<iostream> using namespace std; int main() { int a, b; cout<<“Enter
The post How to rethrow exception using throws in C++ appeared first on Coding Security.
How to rethrow exception using throws in C++
read more
Tidak ada komentar:
Posting Komentar