Hi, I am currently writing a program that will take in patient information that will determine the priority in queue.
I am writing the console application that will gather this information. I am having trouble with retrieving the information.
I am asking for the patients name, type of ailment, the severity, time criticality, and contagiousness.
Each patient can have more than one ailment and I am asking that the type of ailment to be left blank when all ailments have been inputted into the console. However when I leave the ailment field blank (press enter) the console is not registering the \n and continuing with the code. I do not know what I am doing wrong.
I am also having trouble have the information being entered on the same line as the prompt. Currently it is not doing that.
Update: I have figured out why the console was not registering the empty line input in the console. However I am still having trouble with having the input on the same line as each prompt.
Mixing std:: cin >> operator with std::getline can leave a stray '\n' in the input buffer after the cin >> call, which std::getline then consumes (instead of waiting for more user input).
Add a std::cin.ignore(); call after line 25, within the while loop.
If you want input to be on the same line for some aesthetic reason, don't put std::endls at the ends out the cout lines.