I kind of missed the part where you described what the output was supposed to look like. Can you post it again for me?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
And format your code so we can read and understand it. Be sure to use code tags, too.
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
> getline(inMenu1, menuList[index].menuItem);
> item = menuList[index].menuItem;
> inMenu1 >> menuList[index].menuPrice;
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.
cin.ignore(numeric_limits<streamsize>::max(), '\n');
John A
Vampirical Lurker
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339