Say I have user input these variables: ID name age
And I'm using a while loop to get user input like below
while(cin){
cin >> ID >> name >> age;
do_stuff(ID, name, age);
}
but if at some moment the user only input some of those variables, say only ID and name, the while loop should end immediately without running do_stuff(). How should I do this, the method needs to be fast. Thank you!