Question OOP-CTOR-0034
EasyWhat is the output of this code?
#include <iostream>
using namespace std;
struct T {
char c;
T(char x) : c(x) { cout << c; }
~T() { cout << c; }
};
int main() {
T a('1');
T b('2');
}
- A.
12
- B.
1221
- C.
Sign up free to see the answer and a step-by-step explanation.