The code on itself works, tested in a seperate project using only that code, but when including it in this code the output is that when asking for the price and quantity I see:
Price:Quantity:
Then I can only input something after the quantity, meaning that the result (price) is always 0 as I just can't input to price.
Anyone knows what I'm doing wrong?
This is a test program, I know there are different ways to do this but just this on itself isn't working and I'm trying for hours..
This is a common problem. cin >> i only reads the characters it needs. This means that it leaves the newline char in the stream. This newline is them picked up by getline and an empty line is read. All you need to do is add cin.ignore() after cin >> i.