# include # include int main ( ) // // In this version of READ_CHUNKS, we set the size of the string // to the maximum legal limit of an input line, so that we're guaranteed // to be able to read every line in one step. // // The value of LINE_MAX is defined in "", and is big enough // to read any input line. { int i; char line[LINE_MAX]; printf ( "\n" ); printf ( " The longest legal input line has length %i characters.\n", LINE_MAX ); printf ( "\n" ); i = 0; while ( fgets ( line, LINE_MAX, stdin ) != NULL ) { i = i + 1; printf ( "%s", line ); } printf ( "\n" ); printf ( "A total of %i lines were read.\n", i ); return 0; }