Linked list management...

This is a discussion on Linked list management... within the C Programming forums, part of the General Programming Boards category; Hello Reader... My goal is to make a Ansi C program which will me able to read a file and ...

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    2

    Linked list management...

    Hello Reader...

    My goal is to make a Ansi C program which will me able to read a file and based on it's structure to print a generated sentence in a new file.

    My need at the moment is to read content and make arrays and linked lists of the data so i can manage the lists to make a sentence(think of subject--> verbPhrase-->adverb_phrase). My question is how can i manage the file content so i can sort it's data into lists and arrays.

    A simple file of the input file structure has been given to me for test reasons.

    So far i thought i need and array(of max 10) object types(start, subject, animal...) and 1 array for every list(ex. <subject>--><verbPhrase>--><adverbPhrase>) cause i need to pick them randomly and and 1 list for each random pick....

    any suggestions?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Think about it. Everything you said sounds relatively easy to code (by common sense) or google.

    And, you pretty much gave away that it's a homework assignment.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,304
    Oh, so no code yet. You mustn't have read the homework policy.
    You have to get started and show some effort first.

    At this stage we have no idea of you ability level. Seeing some code would help with that. I don't want to end up insulting you and wasting my time by describing how to implement a linked-list, but at the same time I don't want to post complex concepts that are way over your head.
    Make a start and ask a very specific question once you get stuck.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying a linked list into another linked list
    By paranoidgnu in forum C Programming
    Replies: 7
    Last Post: 07-19-2011, 06:21 PM
  2. Replies: 4
    Last Post: 05-01-2010, 10:19 PM
  3. single linked list to double linked list (help)
    By Countfog in forum C Programming
    Replies: 8
    Last Post: 04-29-2008, 08:04 PM
  4. singly linked list to doubly linked list
    By t48j in forum C Programming
    Replies: 3
    Last Post: 03-23-2005, 05:37 PM
  5. Replies: 6
    Last Post: 03-02-2005, 01:45 AM

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