Stdlib itoa function

I searched the web and saw a lot of code that uses the itoa () function, and they claimed that this function is in stdlib.h

I am using 2 versions of GCC right now:

  • (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4))

  • (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)

and both of them do not have the itoa () function (I am compiling the program and the error: undefined reference to `itoa ').

Any ideas? Thanks.

+3
source share
3 answers

itoa()not in the C standard - snprintf()is a function that can be used in its place (at least this is probably the simplest change).

+8
source

Wikipedia : , <stdlib.h>, .

+4

Here's a good article on this issue, starting with the phrase "How to use itoa () with GCC?". The article also contains several implementations of itoa () with uniform performance comparison, please take a look.

+1
source

Source: https://habr.com/ru/post/1722175/


All Articles