file into a linked list

This is a discussion on file into a linked list within the C Programming forums, part of the General Programming Boards category; How do u read any normal text file into a linked list? Lets say i wanted to read a file ...

  1. #1
    pilecom
    Guest

    file into a linked list

    How do u read any normal text file into a linked list? Lets say i wanted to read a file that contained a c program or just a bunch of words or numbers, what should the struct contain?

  2. #2
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    I don't know if this is homework or not....but either way.....

    Please don't ask people to do all your work for you, See the announcement on Homework at the top of the forum to see what is acceptable ro PM. Basically people are happy to help, but they're not going to do it all for you. Show us what you've got, show your code (using code tags), or where you're confused and someone will be happy to help you I'm sure. Feel free to PM me with any questions.

    Though yout specific question on what the struct should contain is a good one, be careful....People won't help if they think they're doing it all for you.


    Good Luck,

    Kermi3
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  3. #3
    pilecom
    Guest
    I wasnt asking people to do my code for me i was just asking for advice.

    All i am inquiring about is that when u read a file that has certain known format u would have variables. For example

    file:
    jon 45 78
    peter 34 79

    then u would have name variables, and int variables in the linked list

    But i just want to read any olf text file, regardless of the format that it is and i was wondering how i should go about this. I dont want all of the code for reading a file i just want to know what the link list should be made up of

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List Not Saving Value as Int
    By bar338 in forum C Programming
    Replies: 4
    Last Post: 05-04-2009, 08:53 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  4. Linked List
    By jpipitone in forum C Programming
    Replies: 4
    Last Post: 03-30-2003, 09:27 PM
  5. singly linked list
    By clarinetster in forum C Programming
    Replies: 2
    Last Post: 08-26-2001, 11:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21