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
Get step-by-step solutions from verified subject matter experts
