All pastes #189546 Raw Edit

Something

public c v1 · immutable
·published 2006-10-03 05:22 UTC
rendered paste body
int number_of_ones(char *character)	{	char count;	int mask[8]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};	int i;	count = 0;	for (i=0; i<8; i++)		{		if (*character&mask[i] != 0)			{			count++;			}		}	*character = count;	if ( (count & 1) == 0)		{		return(0);		}	else		{		return(1);		}	}