Solved

Given the Class Below,tell to What Value the Default Constructor

Question 8

Essay

Given the class below,tell to what value the default constructor initializes the data member.Name this initialization technique and give another way to write the constructor.
class A
{
public:
A();
private:
int a;
};
A::A(): a(17)
{
//deliberately empty
}

Correct Answer:

verifed

Verified

This is a base (or member)init...

View Answer

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

Related Questions