You can scan f by pressing a specific key, in addition to entering

I have a situation here

I take data from the user

using scanf, I can complete the scan as soon as the user presses the # key

please enlighten me on this

+4
source share
1 answer

No, scanf() (or rather stdin, by default) is line-oriented, so it needs to read the full line.

Check out ncurses or similar libraries for raw key-entry keys.

+5
source

Source: https://habr.com/ru/post/1300849/


All Articles