Solved

Given the Class Definition: Class CreateDestroy

Question 5

Multiple Choice

Given the class definition: class CreateDestroy
{
Public:
CreateDestroy() {cout << "constructor called, ";}
~CreateDestroy() {cout << "destructor called, ";}
};
What will the following program output?
Int main()
{
For (int i = 1; i <= 2; ++i) {
CreateDestroy cd;
}
Return 0;
}


A) constructor called, destructor called, constructor called, destructor called,
B) constructor called, constructor called,
C) constructor called, constructor called, destructor called, destructor called,
D) Nothing.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions