【发布时间】:2013-02-07 14:26:45
【问题描述】:
在我的程序中,我尝试将 int 转换为 char[20];
我尝试通过以下方式做到这一点:
char str[20];
sprintf(str, "%d", timer);
其中的计时器是 int。
但是当我构建此代码时,我收到以下警告。
Type implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
incompatible implicit declaration of built-in function 'sprintf' [enabled by default]
这是什么意思?
注意:(我已经包含了string.h和stdlib.h)。
太好了,我在代码中添加了 stdio.h,现在警告消失了,只是给了我一个更严重的错误。
对 `_sbrk' 的未定义引用
【问题讨论】:
标签: string int type-conversion printf