All pastes #202353 Raw Edit

Mine

public text v1 · immutable
#202353 ·published 2006-10-14 12:59 UTC
rendered paste body
here is the code:
//saves data into binary float array
void
i2b(float[] barray, int input, int bits){
	int i;
	for ( i=0; i<bits;i++) barray[i]=0.0;

	int start = bits - 1;

	while( input > 0 && bits >= 0){
		if ( input % 2 == 1){
			barray[bits] = (float) 1;
			input--;
		}
		input /= 2;
		bits--;
	}

}

and here is the error i get
[sleon@slap test]$ LANG=C gcc  -c conv.c
conv.c:3: error: parse error before "barray"
conv.c: In function `i2b':
conv.c:5: error: `bits' undeclared (first use in this function)
conv.c:5: error: (Each undeclared identifier is reported only once
conv.c:5: error: for each function it appears in.)
conv.c:5: error: `barray' undeclared (first use in this function)
conv.c:9: error: `input' undeclared (first use in this function)