Controllate per favore se questa funzione è esatta oppure ha bug?
Generalmente funziona ma non vorrei che ci sono errori "nascosti"...codice:string IntToStr(long long Value) { string Result = ""; unsigned char Temp; char * Temp2; bool IsNegative = false; // Controllo sul negativo if (Value < 0) { Value = -Value; IsNegative = true; } do { Temp = Value - ((long)(Value / 10)) * 10; // Numeri da 48..57 -> 0..9 Temp += '0'; Temp2 = &Temp; Result = Temp2+ Result; Value = (long)(Value/10); } while (Value > 0); if (IsNegative) Result = "-" + Result; return Result; }
Grazie![]()
![]()

Rispondi quotando