Cosa hai provato? È un compito? Puoi usare la STL?
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum