4 ms·
you could check if ret > ret * 10 + characters[i]-48, if so it has wrapped around and you return an error
by voidUpdate 4mo ago
you could check if ret > ret * 10 + characters[i]-48, if so it has wrapped around and you return an error
- Thiez 4mo ago[dead]
- thomashabets2 4mo agoFor unsigned that could work, but signed overflow is UB.