Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I read a single character from the keyboard without waiting for the RETURN key? How can I stop characters from being echoed on the screen as they e typed?

0
Posted

How can I read a single character from the keyboard without waiting for the RETURN key? How can I stop characters from being echoed on the screen as they
e typed?

0

Alas, there is no standard or portable way to do these things in C. Concepts such as screens and keyboards are not even mentioned in the Standard, which deals only with simple I/O “streams” of characters. Input to a computer program typically passes through several stages. At the lowest level, device-dependent routines within the operating system handle the details of interfacing with particular devices such as keyboards, serial lines, disk drives, etc. Above that, modern operating systems tend to have a device-independent I/O layer, unifying access to any file or device. Finally, a C program is usually insulated from the operating system’s I/O facilities by the portable functions of the stdio library. At some level, interactive keyboard input is usually collected and presented to the requesting program a line at a time. This gives the operating system a chance to support input line editing (backspace/delete/rubout, etc.) in a consistent way, without requiring that it be built into e

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123