Q. What is the output of the following C++ program?
Code:
#include<iostream>
using namespace std;
class MyClass {
int val;
public:
MyClass(int v);
};
MyClass::MyClass(int v) {
val = v;
cout << "Constructor called\n";
}
int main() {
MyClass arr[100];
return 0;
}
β
Correct Answer: (C)
Compilation error