Mailinglist Archive: opensuse-programming (68 mails)

< Previous Next >
RE: [suse-programming-e] C++ compile problem. error in function
  • From: Trey Gruel <drathos-suse@xxxxxxxxxxxxxx>
  • Date: Tue, 13 Jan 2004 10:57:37 -0500 (EST)
  • Message-id: <Pine.LNX.4.44.0401131041150.32055-100000@xxxxxxxxxxxxxxxxxxxxx>
> Thanks Trey / Charly / Jerry.

no prob

> Anyway, I have a very strange bug in my program which I can't seem to
> iron out. When I add more stock via the number1 in the menu, everything
> is fine and I can build the stock up, however, if I then try and save
> this to file (via menu num 4) is doesn't always save my new stock, it
> stays as it was.
> e.g. I currently have 11 items in stock. If I go to add another item, it
> doesn't seem to save them.....I thought maybe it wasn't updating
> 'num_stock_items' but am unsure.

i had to make a couple small changes to get it to compile on the redhat
7.3 box i'm sitting at right now (get rid of conio.h/getch and no call to
system(cls)), but i was unable to reproduce the problem.

i tried a couple runs of:

1) enter 2-3 items
2) display them
3) save to disk
4) quitting
5) restart the prog
6) load from disk
7) display them
8) goto 1

every time, all records were saved and loaded.

one comment on your file io: it's a good idea to close the file after
you're done with it.

--
trey


< Previous Next >
Follow Ups
References