CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Language: C++
// Task Description: Improve the existing code, get rid of the extra parts and make sure it prints the text in the default constructor exactly five times.
#include <iostream>
using namespace std;
class myClass {
int a; char b;
public:
myClass() {
cout << "text\n";
}
myClass(int i, char j) {
a = i;
b = j;
}
};
int main() {
myClass T[5];
myClass newObj1;
myClass newObj2(5, '5');
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run