Stai già parlando dello stesso problema qui, chiudo.
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum