Dingoonity.org
Dingoo Official Firmware => Development => Topic started by: creek23 on June 05, 2011, 09:28:18 am
-
is there any other option to convert an int to string? :(
~creek23
-
Implement itoa yourself ?
E.g. like here (http://www.daniweb.com/software-development/cpp/threads/189996).
-
that's pretty much what I was gonna do. I was just hoping there was some kind of implementation in Dingoo SDK.
~creek23
-
sprintf() is the default C function to transform numbers into a string.
-
http://www.cplusplus.com/reference/clibrary/cstdlib/itoa/
Portability
This function is not defined in ANSI-C and is not part of C++, but is supported by some compilers.
A standard-compliant alternative for some cases may be sprintf:
sprintf(str,"%d",value) converts to decimal base.
sprintf(str,"%x",value) converts to hexadecimal base.
sprintf(str,"%o",value) converts to octal base.