C

error: control reaches end of non-void function [-Werror=return-type] [edit]

缺少return

return 0;

error: unknown type name 'bool' [edit]

在C语言标准(C89)没有定义布尔类型,所以会报错。而C99提供了一个头文件<stdbool.h>定义了bool,true代表1,false代表0。只要导入stdbool.h,就能非常方便的操作布尔类型了。

#include <stdbool.h>

注意:C语言 #include 的顺序会引发,有一些基础的定义都无法找到的问题

error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=] [edit]

chr数组长度不够


コメント:



(画像の文字列を入力して下さい)

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS