Question: Answer the questions related to the following code: class X { public: void x1(); protected: void x2(); }; class Y: public X { void y1();

 Answer the questions related to the following code:                                

class X

{

public:

void x1();

protected:

void x2();

};

class Y: public X

{

void y1();

protected:

void y2();

};

class Z : public Y

{

Public:

void z1();

};

main ()

{

X temp1;             Y temp2;               Z temp3;

}

  • Name all member functions of all classes visible through temp1 in the main function.
  • Name all member functions of all classes visible through temp2 in the main function.
  • Name all member functions of all classes visible through temp3 in the main function.

Step by Step Solution

3.52 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Name all member functions of all classes visible through temp1 in the main function 1 function x1 ... View full answer

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

Document Format (2 attachments)

PDF file Icon

635f295fa6e79_231289.pdf

180 KBs PDF File

Word file Icon

635f295fa6e79_231289.docx

120 KBs Word File

Students Have Also Explored These Related Programming Questions!