Thread: calculating the frequency of a word !

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    2

    Unhappy calculating the frequency of a word !

    hello guys,
    who would like to help create a function that calculates the number of a specific word (entered by the user) in a text. the program should continue reading the text until it finds a dot (.)
    the prototype should be : int countWordInText(char* text, int size, char* wordToCount);
    ps : scanf( )” is not appropriate since the text may contain spaces and new lines. e.g. a paragraph.
    The text will have as a sentinel a dot ‘.’
    Have 200 as a MAX_SIZE for the text,


    thank you

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    What sort of "help"?

    If you're looking for a free answer on a plate, then move on.

    Otherwise, post your best effort to date, and ask a specific question, like
    "Here's my code, it reads a line, how do I extract words from the line"
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    good luck.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Word frequency and sorting
    By zyxx_66 in forum C Programming
    Replies: 32
    Last Post: 12-17-2008, 02:30 AM
  2. please help with binary tree, urgent.
    By slickestting in forum C Programming
    Replies: 2
    Last Post: 07-22-2007, 07:55 PM
  3. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  4. Word frequency (printf problem)
    By Tired_ in forum C Programming
    Replies: 6
    Last Post: 11-12-2005, 02:49 AM
  5. Wrong Output
    By egomaster69 in forum C Programming
    Replies: 7
    Last Post: 01-28-2005, 06:44 PM