ffs函数用法详解
ffs函数简介
- 头文件包含
#include <strings.h>
#include <string.h>
- 函数定义
int ffs(int i );
int ffsl(long i );
int ffsll(long long i );
ffs函数常见使用错误
- 编译错误
warning: implicit declaration of function ‘ffs’ [-Wimplicit-function-declaration]
解决办法:包含头文件
#include <strings.h>
#include <string.h>
ffs函数详细描述
ffs ()函数返回单词pi中设置的第一个(最低有效)位的位置。最低有效位是位置1,最高有效位是,例如32或64。函数ffsll ()和ffsl ()执行相同的操作,但采用大小可能不同的参数。
ffs函数返回值
这些函数返回第一个位集的位置,如果i 中没有位集,则返回0
ffs函数其他说明
BSD系统在
评论区