CIS 71 (section 1): Homework 8

Handed out: 3/18/97
Due: by 2:30pm on 4/1/97


Write a program that does the same as the Unix utility wc. That is, given the name of a (text) file, it prints out the number of lines, words, and characters in that file. A line is defined as a sequence of characters terminated by '\n' or by the end of file.
A word is defined as a sequence of non-blank characters that is delimited by blank characters.

Suppose that you have compiled your program hmw8.c into the file a.out, then you would execute:

   % a.out hmw8.c
and your program would say how many lines, words, and characters are in hmw8.c. For example,
   27    138   473

Email program to btrianta@thunder.temple.edu