Answer to Question #269182 in C++ for Amit

Question #269182

WAP to show rethrowing concept in oop by using suitable.


1
Expert's answer
2021-11-21T17:39:13-0500
#include <iostream>


using namespace std;
void func()
{
   try
   {
       throw "Good morning";
   }
   catch (const char*)
   {
   cout <<"\nException inside func\n”;
   throw; 
   }
}
int main()
{
   try
   {
       func();
   }
   catch(const char*)
   {
      cout <<"\nException inside Main";
   }
   
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS