need help with an inventory program

This is a discussion on need help with an inventory program within the C++ Programming forums, part of the General Programming Boards category; I have been trying for 5 weeks now to write a simple inventory program for a "book store". The program ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    need help with an inventory program

    I have been trying for 5 weeks now to write a simple inventory program for a "book store". The program is suppose to update the inBooks file each time a book is sold or delivered into the inventory system. It is suppose to display a menu, list all inventory items, list a single book, sell one book, add inventory, and sort books in alphabetic order by book title. I am having problems in the last 3 functions with the error "local function definitions are illegal. I am taking the errors in the bookDelivery, dailySalesReport, and updateFile functions. In addition to the above errors I am also taking an unexpected end of file found after the last curly brace in the updateFile function. I would appreciate any and all help as this assignment is due Thursday, 9/13. A big thank you to any and all that can help me with the errors.
    Attached Files Attached Files

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Post your code. It's probably a simple syntax error. You are missing a closing brace somewhere, or have misplaced a closing pair of them.

    int foo() {
    void bar(); //bar local to foo... illegal
    return 0;
    }
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    You had a couple of ifs that were like this

    if (something == 'N'); // That semicolon was killing you

    as well as a few other misplaced braces.

    For my compiler, I needed stdio for getchar. It compiles now though.
    Attached Files Attached Files
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    thank you

    Thank you, silent strike. now maybe I can get to the sort and the rest of the program.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can someone look over the program I wrote?
    By brooklyn in forum C++ Programming
    Replies: 10
    Last Post: 04-16-2006, 08:23 AM
  2. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 08:51 AM
  4. inventory program
    By ManicC in forum C Programming
    Replies: 5
    Last Post: 11-12-2001, 08:47 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

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