how to check for the “backspace” character in C

后端 未结 5 509
天涯浪人
天涯浪人 2020-11-30 08:01

I\'d like to know how to check if a user types the \"backspace\" character.

I\'m using the getch() function i.e. \"key = getch()\" in my C program and i

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 08:25

    The type of i/o stream may helps. Standard input stream is a kind of line buffered stream, which do not flush until you write a '\n' char into it. Full buffered stream never flush until the buffer is full. If you write a backspace in full buff stream, the '\b' may be captured.

    Reference the unix environment advantage program.

提交回复
热议问题