![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Expert Programmer
|
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:
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.
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Dec 2005
Posts: 57
Rep Power: 0
![]() |
this is a very interesting problem
i ran your code on my machine and it works just fine. aeskreis@unix40 ~ $g++ del.cpp -o del aeskreis@unix40 ~ $ ./del aeskreis@unix40 ~ $ very strange indeed...it doestn seem to have any effect on the actual running or compiling of the program though |
|
|
|
|
|
#3 |
|
Expert Programmer
|
Well heres some more details:
I'm running g++ version 3.3.6, and i'm using the 2.4 kernel (smite me). Can you check your g++ and kernel versions.
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Dec 2005
Posts: 57
Rep Power: 0
![]() |
im running it from my school's computer so i have no clue what the kernel version is. the most info i could gather is that they are maybe running gnu v. 3.2, but this is carnegie mellon, so im going to assume they have hte most up-to-date versions of everything
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
run this:
cat /proc/version && g++ --version You can copy and paste the output, if your not sure which part to look at. EDIT: I noticed that the box your on is called unix40. Are you sure its Linux? If so which distro?
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
#6 |
|
Programmer
Join Date: Dec 2005
Posts: 57
Rep Power: 0
![]() |
Linux version 2.4.30 (cg2v@manticore.andrew.cmu.edu) (gcc version 3.2.1) #3-i686+-UP (034) Wed May 11 16:33:00 EDT 2005
g++ (GCC) 3.2.1 |
|
|
|
|
|
#7 |
|
Expert Programmer
|
Interesting, your using the 2.4 kernel and using g++ 3.2.1.
My exact details are: 2.4.31 kernel g++ 3.3.6 So it would appear that my box is more updated than your schools one. This is weird.
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
#8 | |
|
Programmer
Join Date: Dec 2005
Posts: 57
Rep Power: 0
![]() |
Quote:
yea, anyway asside from my rant on how CMU sucks, try running it on gnu 3.2 and see if it makes a difference, maybe its a bug in the newer version, or soemthing |
|
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Systems can be set up so that various screen functions are performed in response to various escape sequences. If your system is set up for that, then transmitting an escape followed by various other values will Do Thangs (x-y positioning, clearing, etc.).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|