Question: 6- Here is a small class definition: class small { public: small( ); void k() const; void h(int i); friend f(Small z); private: int size;
6- 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 small objects. 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(42); | . | . | . |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
