Function libwalrus::find2T

Function Documentation

void libwalrus::find2T(char *dst, Byte len, Byte *pos, char offset)

Given a string of length len, finds the positions in which it has a 1 and stores its position i, as 2*i and 2*i+1 in consecutive slots of the array pos.

It also returns (twice) the number of ones in array dst

Return

returns twice the number of ones in array dst.

Parameters
  • dst: character array representing binary digits.

  • len: length of the array dst.

  • pos: resulting character array of length 2*len storing the indices at which dst contains the values 1.