Question: Whats wrong with the following attempts at establishing friends? a. class snap { friend clasp; ... }; class clasp { ... }; b. class cuff
What’s wrong with the following attempts at establishing friends?
a. class snap {
friend clasp;
...
};
class clasp { ... };
b. class cuff {
public:
void snip(muff &) { ... }
...
};
class muff {
friend void cuff::snip(muff &);
...
};
c. class muff {
friend void cuff::snip(muff &);
...
};
class cuff {
public:
void snip(muff &) { ... }
...
};
Step by Step Solution
3.54 Rating (171 Votes )
There are 3 Steps involved in it
a Its illformed because a friend specifier cannot appear in a class definition C03 1... View full answer
Get step-by-step solutions from verified subject matter experts
