adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <exception>
    using namespace std;
    int main () 
    {
        try
        {
            int* myarray = new int[1000];
            cout << "allocated";
        }
        catch (exception& e)
        {
            cout << "Standard exception: " << e.what() << endl;
        }
        return 0;
    }

a.

Allocated

b.

Standard exception

c.

Depends on the memory

d.

Error

Answer: (c).Depends on the memory

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?