Linked Lists and an Inventory Program

This is a discussion on Linked Lists and an Inventory Program within the C++ Programming forums, part of the General Programming Boards category; Hi... I am trying to write code to process a return order and a purchase order for an inventory program. ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    56

    Linked Lists and an Inventory Program

    Hi...
    I am trying to write code to process a return order and a purchase order for an inventory program. However, I get some strange output! I'm not very familiar with linked lists, but basically on a purchase order I am taking information from a master inventory list with DVD's, CD's, etc. and checking the quantity in stock against the quantity that should be in stock, and building a new order list based on that. It works great for the FIRST item only, but it repeats only the first line as many times as I have items in the inventory list. Besides that, the title display should align left, and it actually doesn't really align and adds a couple of extra characters at the end of the title. I can attach a jpg if it helps. I have attached copies of my code snippets files rather than pasting here because I suspect it is not my display method but rather the method I am building the new order list with.
    Of course I don't expect (OR WANT) anybody to do my homework for me but I could really use some pointers.

    Thanks much.
    Attached Files Attached Files
    Last edited by marQade; 05-12-2008 at 06:33 PM. Reason: Replaced incomplete file upload

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    56
    Alright...I've figured out part of my own problem...putting it here so anybody else who was curious can find out.
    To solve the issue of one item repeating itself on the list, the line
    Code:
    fromCur = *fromIter;
    needs to be inside the loop. This still doesn't fix the display problem, so I will try a different method of display.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    56
    The display works when using std::left and std::fixed.

Popular pages Recent additions subscribe to a feed

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