/* ECP: FILEname=fig7_31.c */ /* 1*/ #include /* 2*/ #define MaxN 10 /* 3*/ /* Read Up To MaxItems Ints; No Attempts At Error Recovery */ /* 4*/ int /* 5*/ GetInts( int *Array, int MaxItems ) /* 6*/ { /* 7*/ int i = 0; /* 8*/ printf( "Enter up to %d integers: ", MaxItems ); /* 9*/ while( i < MaxItems && scanf( "%d", Array++ ) == 1 ) /*10*/ i++; /*11*/ return i; /*12*/ }