implicit declaration of function itoa is invalid in c99

匿名 (未验证) 提交于 2019-12-03 02:15:02

问题:

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.

回答1:

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

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



回答2:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!