What happens when you attempt to compile and run the following code?


#include
#include
#include
using namespace std;

class Int {
public:
int v;
Int(int a) : v(a) {}
};

void a() {
throw 0;
}

void b() {
try {
a();
} catch(int i) {
throw Int(i + 1);
}
}

void c() {
try {
b();
} catch(...) {
throw;
}
}

int main(void) {
try {
c();
} catch(Int &i) {
cout << i.v;
}
return 0;
}



Grupo de opciones de respuesta

It prints 1

It prints 2

It prints 0

Compilation fails

Respuestas

Respuesta dada por: oskita2020
0

Respuesta:

ok

Explicación:

Preguntas similares