I am practicing using strings in C++ and the example provided uses getline. I noticed when I use getline the compiler is not outputting the individual inputs of the user, which it should do. Currently the program outputs the correct total price.
Noticing this problem, I switched getline for cin which correctly outputs the individuals inputs of the user and the total price. I would like to know how to recreate these results with getline just to get comfortable with various ways to output.
I have also tried to use cin.ignore, cin.sync, cin.clear as well but no help as of yet.
My code:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string mystr;
float price=0;
int quantity=0;