I noticed, while working on a program, that when i backspace in the input line, it does not delete the characters on the line. It merely moves the cursor back a space and allows me to type over the characters.
When i enter that string, it leaves all the characters that should have been removed by backspace in the string:
here is the simple code that i'm running, which doesn't have any room for errors:Code:stupid account die@jeff ~/sample $ ./input Input a line, and try backspacing over it and correcting it. why won't it delete these from the string?f;lskf;sdj Here is the string as detected by the system: why won't it delete these from the string?f;lskf;sdj stupid account die@jeff ~/sample $
anybody know why this is happening? i don't recall this happening when running programs in windows (this is under bash on linux)Code:#include <iostream> #include <string> using namespace std; int main() { string input; cout<<"Input a line, and try backspacing over it and correcting it." <<endl; getline(cin,input); cout<<"Here is the string as detected by the system:" <<endl; cout<<input; return EXIT_SUCCESS; }



LinkBack URL
About LinkBacks


