Hi fellow programmers. I'm quite new to 'C' and I’ve been working on this personal project recently and have struck a spanner in the works! I am quite bemused by this piece of code I am to assemble (below). I think it’s fairly simple but can’t quite grasp it! Any guidance/code that refers to a program that counts lines and words in the ‘C’ language would be really helpful, here’s the problem…
I need to use emacs to compose an algorithm for counting the number of lines and words in a text file.
The words may comprise of any printing characters and are delimited by spaces and/or tabs.
Also the presence of any control character other than tab, eol (end-of-line), or a single terminating eod (end-of-data), I have considered an error, whereupon the algorithm should terminate.
I will need to give two levels of pseudocode before I create the program.
I then need to enclose my solution to in a comment block and implement my algorithm in C. I need to include comments with your code and I can’t define any other function than main.
Finally I need to devise a test file that serves to adequately test my program.
If anyone can help I will be eternally gratefull!