warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]

linux下编译c语言出警告:

warning: incompatible implicit declaration of built-in function ‘exit’ [enabled by default]

exit() 是个库文件。

要消除警告,要包含库:

#include<stdlib.h>

参考: http://blog.sina.com.cn/s/blog_69eadf4701014rxv.html

打赏