Thread: database....

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Climber spoon_'s Avatar
    Join Date
    Jun 2002
    Location
    ATL
    Posts
    182
    change:

    Code:
    void loadData(structure inventory,FILE *dataFile)
    {
         fgets(inventory.name, MAXchar,dataFile);
    }
    to:

    Code:
    void loadData(structure * inventory,FILE *dataFile)
    {
         fgets(inventory->name, MAXchar,dataFile);
    }
    and change:

    Code:
    loadData(inventory,dataFile);
    to:

    Code:
    loadData(&inventory,dataFile);
    damn, BEATEN! =)

    sorry for the confusion earlier. correct the stuff that thantos pointed out and you should be on your way.

    you were not modifying the structure in the 'main' function when you called 'fgets.' you were passing a copy of the structure, not a reference.

    *waits for better explantion*
    Last edited by spoon_; 01-11-2004 at 11:57 AM.
    {RTFM, KISS}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. literature database: help with planning
    By officedog in forum C++ Programming
    Replies: 1
    Last Post: 01-23-2009, 12:34 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  3. Replies: 10
    Last Post: 05-18-2006, 11:23 PM
  4. Developing database management software
    By jdm in forum C++ Programming
    Replies: 4
    Last Post: 06-15-2004, 04:06 PM
  5. Making a Simple Database System
    By Speedy5 in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2003, 10:17 PM