[COMP] C program to count the number of words in a text file

  • From: Shane McKeown <shane_mckeown@xxxxxxxxx>
  • To: computers@xxxxxxxxxxxxx
  • Date: Mon, 30 Apr 2001 12:45:56 -0700 (PDT)

Hi guys

I have a small problem.  A friend needs help writing a

C program which has to read a text file, and count
the number of occurences of each word in the file.
I know this can be done using Linked-Lists, but his 
version needs to use arrays.  

The input file has the following:
TO BE OR NOT TO BE

and the output should be somthing like:
Word    Occurences
------------------
TO      2
BE      2                       
OR      1                       
NOT     1                       


Can anyone help, or know of anyone that can help?

Thanks

Shane

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
========================================
Avenir Web's Computers Mailing List

List Modes, Subscription, and General Info:
Go to //www.freelists.org/cgi-bin/webpage?webpage_id=11 
List Archives: //www.freelists.org/archives/computers
Administrative Contact: weez@xxxxxxxxxxxxx

Get computer help: http://avenir.dhs.org
========================================

Other related posts: