bcmp函数用法详解
bcmp函数简介
- 头文件包含
#include <strings.h>
- 函数定义
int bcmp(const void * s1 , const void * s2 , size_t n );
bcmp函数常见使用错误
- 编译错误
warning: implicit declaration of function ‘bcmp’ [-Wimplicit-function-declaration]
解决办法:包含头文件
#include <strings.h>
bcmp函数详细描述
bcmp ()函数比较长度分别为n的两个字节序列s1和s2。如果它们相等,特别是如果n为零,bcmp ()返回0。否则,它返回非零结果。
bcmp函数返回值
如果字节序列相等,bcmp ()函数返回0,否则返回非零结果。
评论区