Reading words from a text file

Discussion in 'C' started by wvueagle, Oct 18, 2006.

  1. wvueagle

    wvueagle New Member

    Joined:
    Sep 11, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I need help with reading in text from a file. My final goal is to read in a text file and place each word of the text file into a linked list using dynamic memory (because the size of the file and words will vary between each). I have already decided on using a queue, because I will need to read back off each element in a first in first out manner, but I can not test anything/get any further until I can read in the file. I have tried a few things and the best I can get is the first word of each line. I haven’t used C for a while but for this case I need to get “down and dirty” and use C and am stuck at this point. Thanks for any help!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,336
    Likes Received:
    377
    Trophy Points:
    83
    You are getting the first word because its delimited by space. Put the code here and we can have a look and help you out.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice