And this is what the program is giving out:
Plain Egg $1.45
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
Restaurant Breakfast Menu
Plain Egg $1.45
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
Please help!
Woody
Last edited by WaltP; Jun 4th, 2007 at 6:25 pm. Reason: Added CODE tags -- you actually typed right over how to use them when you entered this post...
And this is what the program is giving out:
Plain Egg $1.45
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
Restaurant Breakfast Menu
Plain Egg $1.45
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
$0.00
It's supposed to display the following:
Plain Egg $1.49 Bacon and Egg $2.45 Muffin $0.99 Restaurant Breakfast Menu Plain Egg $1.49 Bacon and Egg $2.45 Muffin $0.99
The operation inMenu1 >> leaves behind a newline. When getline() is called again, the only thing it picks up is the stray newline, and then of course the menu name is going to be attempted to be extracted into the price. It doesn't work of course, the stream gets an error, and all subsequent reads fail.
You're going to have to remove the newline after you extract the price.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.