Thread: Help finding out how many time each word of a documment appear in one text.

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    5

    Help finding out how many time each word of a documment appear in one text.

    Sorry for the not describring subject. But i have been trying to do somehting the last few days and was unable to..

    I have a character matrix wich have a text in it.

    I need to know how many times each word occur in this text.

    Any hints, tips or ideas are apprecitated.

  2. #2
    The Artful Lurker Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    strstr() is a pretty good hint. Try a Google search for the strstr() man page, or check your IDE's documentation on it. It will allow you to do what you want fairly easily.
    Jason Deckard

  3. #3
    Registered User bljonk's Avatar
    Join Date
    Oct 2001
    Posts
    70

    Smile

    strstr() searches a string contained in another string;

    #include <string.h>
    char *strstr(const char *s1, const char *s1);

    return a value that points to the location of the string s2 in s1;

    i hope it helps
    Ünicode¬>world = 10.0£

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    5
    Hey Guys thanks for the help. I checked out how to use strstr() and i also found out another useful string method called strtok() which im using to get the words, and after i get them i use strstr() to count how many times it appears on the text.

    Thanks for the help, now i can keep implementing my program

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. text processing assignment
    By nellosmomishot in forum C Programming
    Replies: 28
    Last Post: 11-25-2008, 03:56 PM
  2. Replies: 7
    Last Post: 06-16-2006, 09:23 PM
  3. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  4. I apologize. Good bye.
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 05-03-2002, 06:51 PM
  5. Using text in MS Word
    By nate11000 in forum Windows Programming
    Replies: 2
    Last Post: 03-14-2002, 04:25 PM