Question: Consider the class declaration below. Which class methods will be invoked by the following statements that may be coded in a main function? Explain the

Consider the class declaration below.

Which class methods will be invoked by the following statements that may be coded in a main function? Explain the reason each of the constructor you have chosen will be invoked?

(a) Golfer nancy;

(b) Golfer lulu(Little Lulu);

(c) Golfer

*par = new Golfer(nancy);

class Golfer

{

private:

char *fullname;

int games,

*scores;

public:

Golfer();

//#1

Golfer(const char *, int g = 0);//#2

Golfer(const Golfer &);

//#3

~Golfer();

};

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!