Question: Here is a small class definition: class small { public: small( ); void k() const; void h(int i); friend f(Small z); private: int size; };
Here is a small class definition:
class small {
public:
small( );
void k() const;
void h(int i);
friend f(Small z);
private:
int size;
};
Suppose that x and y are both objects of this class. Write the word "legal" or "illegal" in each location of this table to indicate whether the indicated statement is legal or illegal in these locations:
| Statement | In a main program | In the const member function k | In the friend function f |
| x =y; | |||
| x.size = y.size; | |||
| x.size = 3; | |||
| x.h(40); |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
