Whats wrong with the following attempts at establishing friends? a. class snap { friend clasp; ... };

Question:

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 &) { ... }
...
};

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

C++ Primer Plus

ISBN: 9780321776402

6th Edition

Authors: Stephen Prata

Question Posted: