【初心者歓迎】C/C++室 Ver.82【環境依存OK】

このエントリーをはてなブックマークに追加
294デフォルトの名無しさん
相談室にいましたが初心者スレのほうがいいと思ったのでこっちで質問します。

#include <iostream>
using namespace std;

class Parent {
private: class Child {
private: string name;
public: void setName(string name) { this->name = name; }
public: string getName() { return this->name; }
};
private: Child child;
public: Child getChild() { return this->child; }
};
int main() {
Parent parent;
parent.getChild().setName("ko");
cout <<parent.getChild().getName()<< endl;
}

これで子の名前が帰ってこないのはなぜなのですかね?