#include <iostream>

using namespace std;

class Rat{
    int numer;
    int denom;
public:
    char *name;
    Rat(){cout << "ctor\n"; name = new char[30];}
    Rat(const Rat&);
};

Rat::Rat(const Rat& other){
    cout << "copy ctor\n";
    numer = other.numer;
    denom = other.denom;
    name = new char[30];
    strcpy(name, other.name);
}

int main(){

    Rat a;
    Rat b;

    strcpy(a.name, "spam");

    Rat c = a;
    //a.numer = 3;
    //c.numer = 4;
    //c = a;
    cout << "a.numer " <<a.numer << endl;
    cout << "c.numer " <<c.numer << endl;
    cout << "c.name " << c.name << endl;

    return 0;
}

