解决warning: incompatible implicit declaration of built-in function 'malloc'

因为代码中使用了malloc函数和字符串函数。编译时出现错误

warning: incompatible implicit declaration of built-in function ‘malloc’
warning: incompatible implicit declaration of built-in function ‘bzero’
warning: incompatible implicit declaration of built-in function ‘strncpy                                                                                                 ’
warning: incompatible implicit declaration of built-in function ‘strlen’


解决的方法:

        增加头文件就可以

#include<stdlib.h>

#include<string.h>

posted @ 2016-02-02 09:25  mfrbuaa  阅读(3264)  评论(0编辑  收藏  举报