Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ffs - seek first set bit

&pagelevel(4)&pagelevel

Syntax

#include <strings.h>

int ffs(int i); 

Description

ffs() searches for the first set bit in the transferred argument, beginning with the
leastsignificant bit, and returns the position of this bit. The numbering of the bits begins with 1,
starting with the least-significant bit.

Return val.

Position of the first set bit


if i != 0.             

0

if i = 0.

See also

strings.h.