This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to let gets() work correctly?

IN C Starndard lib, use gets can input string form stdio.

for example, push [backspace] can remove the last char.

But when i use gets(), it keep backspace char (0x0B).

Parents Reply Children
  • I don't think the VC++ documentation claims such behaviour either, since such behaviour is not part of the C standard and platform-specific behaviour should only be introduced when the platform so needs.

    I can't find anything in my VC++ documentation.

    But as I did mention - when the sending side handles the data line-by-line instead of character-by-character, it can process the backspace character so you may see this behaviour in a test program even if it isn't gets()/fgets() that is doing the backspace processing.