samedi 28 février 2015

CIN Taking Multiple Inputs


string one, two; cin>>one>>two;


I am using that code to take two inputs. Problem is that I want the second input to be optional. So when a user puts in inputs such as text1 without a second input and presses return the program should not expect another input from the user. Currently it is, and I need to press return on a blank line. Any way to achieve this scenario?


UPDATE: I was thinking of using a vector variable. Is there any way to capture all the input from the cin that way?




Aucun commentaire:

Enregistrer un commentaire