I want to accept several characters in my input and process them as they are being typed. I would use it like that:
char c;
string line;
while((c = getchar() != '.'))
line += c;
cout << line << endl;
The expected behavior would be to stop getting inputs as soon as a '.' char is typed, without the need for the return button to be pressed.