#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    C Programming HW Help


    Hey all. I'm new to this forum and also to C. This homework is killing me, I have no idea how I should start it. Essentially, I have to read a text file whose input file has a list of these:

    1301,204415019,"LastName","FirstName",EEE, 230,="R01"

    and categorize them into their respective columns, sorted by name. I have to put the info from the file into an array of structs and output the data in a table format. I need to use two or more source files and a makefile.

    The problem here is that I've just learned about all these things and I don't really know what the general process should be like. Some tips and pointers would be cool.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,905
    Rep Power
    481
    Please post an effort, even if it's an outline of an algorithm.

    LOAD DATA:
    while there's more in the file
    -read line
    -parse line
    -store the parse result into an array


    SORT:
    qsort(correct,arguments)

    DISPLAY:
    for each record
    -show it



    Makefile


    override CFLAGS += -Wall -g

    hw1: hw1.c hw.h
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    17
    Rep Power
    0
    I finished your homework. You want a peudocode of it?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Sure


    As long as its the general idea sure. As much as I would love a straight up answer, I can't accept it. My pride won't let me haha. If your code is pseudo as you say, I would much apreciate it.

IMN logo majestic logo threadwatch logo seochat tools logo