Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with C prog..need to count unique words

    Hi, I need to count and print the number of words and unique words in a text file. This is a C program.

    so far i've only been able to count and print the total number of words read in from a text file. i did it using strtok().

    but now i have a problem with counting and printing the number of unique words in the file.
    1. all punctuation n spaces to be ignored
    2. assumed no word longer than 20 characters
    3. case insensitive

    any help would be appreciated. thank you!

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    as it says in the rules we don't do homework problems here, we will only help with your solution, if you need help getting started then thats what you need to ask.

    you might try using a subString to hold the first word and compare that to every other word then move on to the next word anc continue till the end. This is a brute force way and will be ugly but will get the job done.


    Jason

  • #3
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thks, that did help a little...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •