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

scanf - how to delete a char in the in-buffer ?

I use scanf for input from a keyboard and echo in a display. It works good, but for the backspace-key I need to delete the last character from _getkey()-input. ?

Thanks in advance.
Dieter

Parents Reply Children
  • scanf does not have an real input buffer, instead the input is process already at the time it is entered. Therefore it is impossible to use backspace to delete the last input character.

    You should use instead a getline function and the sscanf function as implemented in the MEASURE example. Therefore take a look to the file: Keil\C51\Examples\Measure\GetLine.C.