"Non funziona" non vuol dire niente, che problemi dà esattamente?
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum