Solved

Given the Class Definition: Class CreateDestroy

Question 9

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

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents