隐式声明与内建函数不兼容问题

来源:互联网 发布:linux 文件删除 最旧 编辑:程序博客网 时间:2024/06/03 00:06

其实在很多程序中都会出现类似的情况,因此为了方便,我们在编写程序时都把常用的头文件加上,或者将常用的头文件和函数编写到一个自定义的头文件中。

警告:隐式声明与内建函数 ‘memset’ 不兼容   ---------->man memset

MEMSET(3)                  Linux Programmer’s Manual                 MEMSET(3)

NAME
       memset - fill memory with a constant byte

SYNOPSIS
       #include <string.h>

       void *memset(void *s, int c, size_t n);

DESCRIPTION
       The  memset()  function  fills the first n bytes of the memory
       area pointed to by s with the constant byte c.

RETURN VALUE
       The memset() function returns a pointer to the memory area  s.

CONFORMING TO
       SVr4, 4.3BSD, C89, C99, POSIX.1-2001.

SEE ALSO
       bzero(3), swab(3), wmemset(3)
:

我们可以看到里面的头文件#include<string.h>,把他加进去就ok了。


原创粉丝点击