This is readinput.c in view mode; [Download] [Up]
#include "pv.h"
/*
* read up to size samples into array from stdin
* zero-pad if EOF encountered while reading
* return number of samples actually read
*/
int readinput( float array[], int size ) {
float value ;
int count ;
for( count = 0 ; count < size ; count++ ) {
if ( scanf( "%f", &value ) == EOF )
break ;
array[count] = value ;
}
if ( count < size ) {
int i = count ;
while ( i < size )
array[i++] = 0. ;
}
return( count ) ;
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.