ところで、malloc や strcat つかうなら

#include <cstdlib>
#include <cstring>
あたりを入れるべきじゃ?

逆に#include <string> はこのプログラムだと意味ない。