Thread: arrary of records

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    73

    arrary of records

    I need to create an array of records to read my inventory file and store multiple files until the 0 key is entered...can someone direct me where I can read about his stuff..my book believe it or not is not much help.

    Bryan

  2. #2
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    >I need to create an array of records to read my inventory file and store multiple files until the 0 key is entered...

    and I need to stop doing other people's homework and start working on mine.

    here's an idea, now unless you post some code, no one is going to help you.

    make a struct for the stuff you will be dealing with in these so called records.
    Code:
    struct record
    {
        int id;
        char name[20];
    };
    design how the file will be layed out maybe something like
    Code:
    0
    my name
    1
    second name
    2 
    third name
    and come up with your own way of inputting it correctly. If you cannot do this then go back and learn the basics more.

    as for when you press the '0' key it's up to you... if you don't mind platform specific (dos) use getch()
    otherwise when you prompt for something you can check if the input was '0'

    it's up to you.

    -LC
    Last edited by Lynux-Penguin; 09-29-2003 at 08:28 PM.
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. reading a file into a block
    By mickey0 in forum C++ Programming
    Replies: 19
    Last Post: 05-03-2008, 05:53 AM
  3. Counting number from a random file
    By kamisama in forum C Programming
    Replies: 42
    Last Post: 02-22-2005, 05:16 PM
  4. display records held in a struct
    By colinuk in forum C Programming
    Replies: 3
    Last Post: 02-02-2005, 07:51 AM
  5. For loop ; printing records
    By Prezo in forum C Programming
    Replies: 3
    Last Post: 09-15-2002, 06:38 AM