C++小说

本想用C++写一个小说的,刚动笔,发现还是有些难度。细节不好表现。不知以后会不会捡起。

// The class of Person
class Person {
public:
    void Say(string words, Person *listener = NULL);
    Person();
    ~Person();
    Person *Mother() { return mother; }
    Person *Father() { return father; }
    void Name(Person &child, string name);

private:
    int age;
    string name;
    Person *mother, *father;
    vector knowledge; // all knowledge the person knows.
    vector ability;
    vector understanding;

protected:
};

// 在此处增加一个线程,代表我的成长;
Person *i = new Person(BOY, 1989);
i->Mother()->Name(i, "InAsh");

// 在此处增加一个线程
Person *you = new Person(Girl, 1990);

评论