![]() |
|
Convert int to char* |
Calle Arnesten
Member #1,356
April 2001
|
How do I in C++ convert integers to char*? |
lwithers
Member #630
September 2000
|
You could either write your own routine (which isn't difficult), or you could use the C library's sprintf() (there is nothing wrong with using libc calls in C++). |
Jason Heim
Member #484
June 2000
|
careful! of course in this case, it is even better handled by a macro: good luck! |
brain21
Member #1,208
December 2000
|
What about just using the itoa() command? |
Jason Heim
Member #484
June 2000
|
brain21, you mean atoi(), which converts the other way i've never heard of itoa(), not to say that it doesn't exist, but it all probably uses the same routines behind the scenes (although sprintf would obscure it a little). the C reference i have doesn't list itoa(), only atoi(). good luck! |
Bob
Free Market Evangelist
September 2000
![]() |
itoa() is present in DJGPP, but it's listed as non-Ansi, non-Posix, so chances are it won't work on other compilers. [ May 30, 2001: Message edited by: Bob ] -- |
|