Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

implicit declaration of function itoa is invalid in c99

Tags:

c

When I try use the function itoa(), I get the warning:

implicit declaration of function is invalid in c99.

I have included stdlib.h on my header. I'm trying to call this function inside a function, I'm not sure if this is allowed.

like image 405
maxflow Avatar asked Apr 15 '12 13:04

maxflow


2 Answers

The problem is that itoa() isn't a standard function.

You should take a look at this link which gives you some alternative implementations

like image 140
Marco Avatar answered Sep 19 '22 19:09

Marco


An alternative that is commonly used in place of itoa is sprintf/snprintf. These are part of stdio.h.

like image 22
Mike Kwan Avatar answered Sep 18 '22 19:09

Mike Kwan