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 15:12:15 -0500 (EST)
  • Message-id: <Pine.LNX.4.44.0401131442400.586-100000@xxxxxxxxxxxxxxxxxxxxx>
> It seems to stick on 11. It won't always let me input item number 12.
> The items i'm trying to enter are as follows.
>
> Code Description price
> ------ -------------- ------
> 1000 Salt 0.56
> 1001 Rock Salt 0.89
> 1010 Peppercorns 1.59
> 1020 Plain Flour 1.11
> 1021 Wholemeal Flour 1.35
> 1022 Self Raising Flour 1.40
> 1030 Cane Sugar 1.20
> 1031 Icing Sugar 1.30
> 1032 Brown Sugar 1.35
> 1040 White Rice 1.10
> 1041 Brown Rice 1.15
> 1050 Yeast 4.50
> 1051 Dried Yeast 3.65
>
> If I follow it in that order, I am not able to get past item number 11.
> If I enter random data however, (just tapping any old input) I don't have any
> problems.
> I've been chasing this bug for ages now...heh.

hate to say it, but it works for me with gcc 2.96 and 3.2 (both redhat
machines)

> If anyone gets a spare 20 mins, I would be greatfull if you could enter this
> data and see if you find the same bug. I have only tried this on a Windows
> machine, but I think if <conio.h> is swapped for <curses.h> (for getch()) and
> if <stdlib.h> is added for the system call (obviously the function needs
> swapping from 'cls' to 'clear') then everything should work OK.

coulda done that, but for seeing what was going on, i felt that streaming
the output was simpler.

> I have attached the file just in case there is a good samaritan :)
> (i'm also stuck on formating the print_bill() output)

you should look at the justification of the output and where you're doing
your 'setw's.. as it is right now, the weight is right justified with the
field width starting at the end of the product description.

--
trey


< Previous Next >
References