ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void empty() throw() 
{
    cout << "In empty()";
}
void with_type() throw(int) 
{
    cout << "Will throw an int";
    throw(1);
}
int main() 
{
    try 
    {
        empty();
        with_type();
    }
    catch (int) 
    {
        cout << "Caught an int";
    }
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.