Thread: A little help for a beginner.

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    1

    A little help for a beginner.

    I am a freshman in programming so basically, I am a beginner to all these C language stuffs. Our professor gave us a project and I am really lost. Here:

    "Generate a Student Directory with the fields listed below:
    1. Last name
    2. First name
    3. Middle name
    4. Student number
    5. Course
    6. Contact no.
    7. Email

    Create a program with the ff. functions:
    [1] Add New Record
    [2] Delete a Record
    [3] Search for a Record
    [4] Display All (last names arranged in alphabetical order)
    [5] Save to a File (Directory.txt)
    [6] Exit

    At the start, the program will read from a file named Directory.txt (if it exists), and will load the contents of the file in a linked list which will be used by the program."


    Thank you

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,657
    Announcements - C Programming
    A development process

    > At the start, the program will read from a file named Directory.txt (if it exists), and will load the contents of the file in a linked list which will be used by the program."
    Start simple.

    Like for example, a fixed number of students (say 3), stored in an array (not a linked list), without the load/save functionality.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    First things first. Look at this link to see the views on people doing homework.

    Now, two small questions that might help get you started.

    What do you think a single record in the student directory might contain?

    What do you understand a linked list is? What do you think a linked list of records might do?
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  4. #4
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Quote Originally Posted by ixapie View Post
    I am a freshman in programming so basically, I am a beginner to all these C language stuffs. Our professor gave us a project and I am really lost. Here:

    "Generate a Student Directory with the fields listed below:
    1. Last name
    2. First name
    3. Middle name
    4. Student number
    5. Course
    6. Contact no.
    7. Email

    Create a program with the ff. functions:
    [1] Add New Record
    [2] Delete a Record
    [3] Search for a Record
    [4] Display All (last names arranged in alphabetical order)
    [5] Save to a File (Directory.txt)
    [6] Exit

    At the start, the program will read from a file named Directory.txt (if it exists), and will load the contents of the file in a linked list which will be used by the program."


    Thank you
    You are not lost, you are just lazy. There is a major difference between the two.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help!! I'm A Beginner...
    By jimgeor in forum C Programming
    Replies: 3
    Last Post: 05-28-2012, 04:04 AM
  2. C++ Beginner
    By Ronzel in forum C++ Programming
    Replies: 2
    Last Post: 06-04-2009, 03:06 AM
  3. Help Beginner
    By b-k24 in forum C Programming
    Replies: 13
    Last Post: 02-21-2009, 12:53 PM
  4. C and SDL for a beginner
    By a.mlw.walker in forum C Programming
    Replies: 9
    Last Post: 02-05-2009, 02:22 PM
  5. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM