• Source
    1. #include<iostream>
    2. using namespace std;
    3.  
    4. void Rethrow()
    5. {
    6. try
    7. {
    8. throw "ERROR";
    9. }
    10. catch(const char*)
    11. {
    12. cout<<"Caught Exception"<<endl;
    13. throw ; //Rrethrow the exception
    14. }
    15. }
    16.  
    17. int main(){
    18. try
    19. {
    20. Rethrow();
    21.  
    22. }
    23.  
    24. catch(const char* a)
    25. {
    26. cout<<a;
    27. }
    28. }