C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 11 Topic 2 Discussion

C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 11 Topic 2 Discussion

CPA-21-02 Exam Topic 2 Question 11 Discussion:
Question #: 11
Topic #: 2

What happens when you attempt to compile and run the following code?

#include

using namespace std;

class First

{

public:

First() { cout << "Constructor";}

~First() { cout << "Destructor";}

void Print(){ cout<<"from First";}

};

int main()

{

First FirstObject;

FirstObject.Print();

}


A.

It prints: Constructorfrom First


B.

It prints: Constructorfrom FirstDestructor


C.

It prints: Constructorfrom FirstDestructorDestructor


D.

Compilation error at line 16


Get Premium CPA-21-02 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.