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:
Verified
Q4: Member access specifiers (public and private) can
Q5: Member function definitions:
A) Always require the scope
Q6: Which of the following statements is false
Q7: The type of function a client would
Q8: Parameterized stream manipulator setfill specifies the fill
Q10: Which of the following is not true
Q11: A class-scope variable hidden by a block-scope
Q12: Variables defined inside a member function of
Q13: Which of the following statements is false
Q14: Given the class definition: class CreateDestroy
{
Public:
CreateDestroy() {cout
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents