Intern — Middle
Find and correct the errors in the given program
livecode
Task condition
The following code fragment contains syntax and logical errors, which prevent the program from compiling and working correctly. Fix them so that the code compiles and runs successfully.
#include <iostream>
class A {
public:
A() {}
A() {
throw 42;
}
};
int main(int argc, const char * argv[]) {
try {
A a;
throw 32;
} catch(int a) {
std::cout << a;
}
}