Can anyone please tell me what's going on here. I'm using MSVC++ and it builds sucessfully but somewhere something is obviously messed it. Once i try to debug it just shows weird numbers.
int k=0; //could this be the problem??? since 0 would be over writing any given value. but if i leave int k; it showsa warning and MSVC would count that as an error.
I'm sorry, I'm not catching it? 0 is what throwing me off. I think 0 is the one creating the problem. since int k=0 would be over writing the menu price item and messing up the calculations.
But if i leave it only as int k;
then visuall c++ throws an error stating k is unitialized?
lol at mind blown. Although thanks alot. It certainly helped alot. now if the person is ordering only one item it executes the code correctly. but say he/she wants 2 or more items it goes back to the same bizare numbers? Am i doing the calculation wrong or is the code need modification? I did try int k =1; 2; 3;....8; but same results.
It's a visual studio default header whose only purpose is to include other files.
Back to the topic: Why not storing a table of items so you won't need all those switch/case's?
That makes it easier to spot the problem, but it's probably some operation skipping/overriding somewhere.
---
Yes, operation skipping because no matter user input, getdata only asks once what the user wants to buy. You should put a loop after the cin of c.