I wrote this little program to show what I'm talking about
:
[php]#include <iostream>
int main(int argc, char** argv)
{
std::cout<<char(27)<<std::endl;
return 0;
}[/php]
I'm using g++ to compile this, and when run it removes the first character of the next line in the terminal.
Example:
Quote:
|
Originally Posted by terminal
jack@slackbox:~/files/cpp$ g++ del.cpp -o del
jack@slackbox:~/files/cpp$ ./del
ack@slackbox:~/files/cpp$
|
Notice the missing "j" on the last line.
I was just wondering why it removed this character when printing the ASCII code for the escape key.
Can anyone enlighten me?
EDIT:
On further inspection, i found that if i remove the endl from the statement, the first character of the next line is not removed. This makes em even more confused as to why this is happening.