Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
To you CPP-devs,
I want to write a small ask-password tool, like systemd-ask-password, but tty-only and non-systemd.
I use termios to switch the terminal into noncanonical mode and disable echo of stdin.
Now I want to read chars from cin and append them to a string, until I read an endl or an error occurs.
In C, I could use an input-loop with getchar, but how could I do this the CPP-way, since cin.get() is nonblocking?
question