![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
Hi, U can rethrow an exception whenever u caught the exception in C++, But u have to have a nested try{} --- catch{} block for the same i think., More info welcomed... -Balaji.S #include<iostream> using namespace std; void forException(int iErr) { if(iErr == 10) { throw iErr; } } int main() { int i=10; try { try { forException(i); } catch(int iErr) { cout<<"Caught Int Exception: "<<iErr<<" ...Rethrowing it...\n"<<endl; throw iErr; }int main() { int i=10; try { try { forException(i); } catch(int iErr) { cout<<"Caught Int Exception: "<<iErr<<" ...Rethrowing it...\n"<<endl; throw iErr; } } catch (int rethrowned) { cout<<"Rethrowned int exception: "<<rethrowned<<" Caught.."<<endl; } return 0; } |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|