Results 1 to 6 of 6
hi,
i am using itoa & when i was compiling the following error msg is coming:
implicit declaration of function ‘itoa’ Excercise Excercise.c line 74 1214390285696 2514
help me to ...
- 06-25-2008 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 4
itoa
hi,
i am using itoa & when i was compiling the following error msg is coming:
implicit declaration of function ‘itoa’ Excercise Excercise.c line 74 1214390285696 2514
help me to solve this problem.........................
- 06-25-2008 #2
You generally get the implicit declaration error when you haven't included the header where the function you're using is defined. Tip: Manpages are useful to find out what headers define the function you need.
However, the itoa function is not in any C standard and thus not included with all compilers (headers). Generally the function is in stdlib.h, so make sure you include it in the source file:Code:# man itoa
Code:#include <stdlib.h>
- 06-26-2008 #3Just Joined!
- Join Date
- Jun 2008
- Posts
- 4
itoa error
hi thans,
i included stdlib.h. but it showing error msg
- 06-26-2008 #4Just Joined!
- Join Date
- Dec 2007
- Location
- bangalore
- Posts
- 38
- 06-26-2008 #5
As I said there is an itoa function that sometimes is included in the standard libraries of the compiler - though in most cases it is not (because itoa is not in ANSI C).
So, if you really want to use itoa (convert int to ASCII) you could write your own function since you obviously use a compiler that follows the standards (which is good).
PS. When writing your own itoa watch out for memory leaks and buffer overflows.
- 06-26-2008 #6Just Joined!
- Join Date
- Dec 2007
- Location
- bangalore
- Posts
- 38
yep, watchout for buffer overflows...which is really important


Reply With Quote
