Usa la classe std::string e dimenticati di questi problemi.
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum