PDA

View Full Version : erasing printed characters from terminal



pipenor
May 13th, 2009, 11:21 AM
Hello,
I am writing a program in which i want to emulate the capability of the terminal to erase characters after they are printed.
For example:
When i press the up arrow in the terminal the last command i typed is printed and when i press backspace i can erase some characters from it. However when a programs printf/write some data to stdout they can't be simply erased with backspace.
Is there any functions in order to achieve this functionality?

Thanks in advance.

dwhitney67
May 13th, 2009, 01:35 PM
Look into the ncurses library. It will have the functions for doing exactly what you need.