itoa
hi,
any function is there in linux inceded of itoa.but it is working in windows. |
sprintf() ?
--- rod. |
yes,
u can use sprintf ....... exapmle, main() { .... char ar[20]; int x=255; sprintf(ar,"%d",x); .... } |
hi thns,
i want to convert integer to string.sprintf is not working correctly. pls help me. |
Hi -
"Itoa" was popular in a number of DOS-era compilers (like Turbo C), but it was never officially a "Standard C" library function, and it was notoriously vulnerable to buffer overruns. "sprintf()" is an alternative to "itoa()"; "snprintf()" is an even better alternative: Code:
#include <stdio.h> PS: I assume when you say "itoa isn't working correctly", you probably mean that your compiler isn't recognizing it as a valid function. Again, "snprintf" is probably both a more portable and more robust solution... |
Quote:
--- rod. |
All times are GMT -5. The time now is 07:00 AM. |