# include # include void capital_string ( char s[] ); int main ( ) // // This program reads the gettysburg address and makes a capitalized version. // // The value of LINE_MAX is defined in "", and is big enough // to read any input line. // // CAPITAL_STRING accepts a character array as input, and returns // a capitalized version. // { int i; FILE *input; char line[LINE_MAX]; FILE *output; input = fopen ( "gettysburg.txt", "rt" ); output = fopen ( "gettysburg_cap.txt", "wt" ); i = 0; while ( fgets ( line, LINE_MAX, input ) != NULL ) { i = i + 1; capital_string ( line ); fprintf ( output, "%s", line ); } fclose ( input ); fclose ( output ); printf ( "\n" ); printf ( "A total of %i lines were read.\n", i ); return 0; }