1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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,276
    Likes Received:
    364
    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