Answer to Question #272523 in C++ for hgvhjvjh6

Question #272523

WAP to show rethrowing concept in oop by using suitable


1
Expert's answer
2021-12-04T04:24:11-0500
#include <iostream>


using namespace std;
void function()
{
    try
    {
        throw "Good day";
    }
    catch (const char *)
    {
        cout << "\nException inside function\n";
        throw;
    }
}
int main()
{
    try
    {
        function();
    }
    catch (const char *)
    {
        cout << "\nException inside main function";
    }


    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