C Program that Counts words like a Unix word count
I was given an assignment in which i have to write a C program that will read data from standard input one character at a time and output the results to standard output. This program should work somewhat like the Unix word count program wc.
The program should count the number of words and lines in the input stream, and print these two numbers on the standard output. Each of these numbers should be right-justified in an 8-column field. The (decimal) number representing the number of words should be in the first 8-columns and the number of lines should be in columns 9-16. Counting the number of words depends on the definition of a word. For this assignment, a "word" is a maximal [nonempty] sequence of characters that do not include blanks, tabs, newlines, hyphens (-), nor colons. Thus "one;two" is considered a single word, but "one:two" would count as two words.
I am use to using java, which we were introduced from the beginning of this course. Sorry if i am asking for much, i am just really panicking because C programming is so new to me.:frown: