Uzupeªni¢ podane klasy i funkcje, tak aby zadziaªaªa podana ni»ej funkcja main:
#include <iostream>
#include <cstring>
using namespace std;
class Person {
char* name;
public:
friend class Couple;
friend ostream& operator<<(ostream& str, const Person& os);
Person(const char* n);
Person(const Person& os);
Person& operator=(const Person& os);
~Person();
};
class Couple {
Person *husb, *wife;
public:
friend ostream& operator<<(ostream& str, const Couple& p);
Couple(const char* m, const char* z);
Couple(const Couple& p);
Couple& operator=(const Couple& p);
~Couple();
};
int main(void) {
Couple *c1 = new Couple("John","Sue");
Couple c2("Bert","Elsa");
*c1 = c2;
Couple c3(*c1);
delete c1;
cout << c3 << endl;
}
Program nie powinien pada¢ i wypisa¢ co± w rodzaju
He: Bert, She: Elsa
Moglibyście dać mi jakieś wskazówki do tego zadania?? Za bardzo nie wiem co wpisać w te metody, żeby otrzymać taki wynik..