Quote:
Originally Posted by Colin Mac
The newline character is in the buffer from hitting the the enter key.
Code:
cout << "Enter the pizza diameter: ";
cin >> ptr->diameter;
cout << "Enter the pizza weight: ";
cin >> ptr->weight; // why doesn't this cin get autofilled by the newline char after inputting the value above? (ptr->diameter)?
cout << "Enter the pizza company name: ";
cin.getline(ptr->name,20);
Right, i get that. But if this is the case, how come the second 'cin >>' isn't auto filled by the newline char created by the first cin?