how to store data from a txt file into a linked list?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shayang
    New Member
    • Mar 2008
    • 1

    #1

    how to store data from a txt file into a linked list?

    hello, I have a question.
    I want to store 5 number in a txt file into a linked list
    say the 5 numbers are
    5
    4
    3
    6
    7

    thanks very much。
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    Presumably, you are capable of creating a linked list and inserting arbitrary numbers. Now, you need to insert fixed numbers from the text file. So, read from the text file. As you read each number, insert it into that linked list.

    If you do not know how to read from a text file, then you need to go through documentation or your textbook or whatever to see how to do file i/o. If you can't create a linked list, once again, consult documentation or Google or your book.

    Comment

    Working...