You are not logged in.
Pages: 1
Hi, something strange happened today i made a c program to print all the ascii characters but when i run it the terminal, the terminal gets all screwed up, even if i run it without x on the console!!
this is a screen-shot of my desktop with the code and the terminal screwed up characters.
http://img145.imageshack.us/my.php?image=cenas.png
the code:
#include <stdio.h>
main(){
char n=127;
while (n){
n--;
printf("%c",n);
}
}
Last edited by golfadas (2009-03-05 14:37:40)
Offline
http://tldp.org/HOWTO/Text-Terminal-HOW … tml#ss17.9
In short: terminal input/output is pure magic (try reading the whole howto), but <enter>, 'reset', <enter> should fix it.
1000
Offline
You are trying to print the entire ASCII table. If you look at the ASCII table http://www.asciitable.com/, the lower range characters (less than 32) are not really printable characters, are they?
Offline
You are trying to print the entire ASCII table. If you look at the ASCII table http://www.asciitable.com/, the lower range characters (less than 32) are not really printable characters, are they?
no but that's not the problem, when the program returns the part:
bernardo@sonyarch
is written as something strange, its like the key map have changed.. if you look closely at the screenshot you can see the cursor after some weird characters.
if i try to write only numbers come out right everything else is pretty weird.
Offline
http://tldp.org/HOWTO/Text-Terminal-HOW … tml#ss17.9
In short: terminal input/output is pure magic (try reading the whole howto), but <enter>, 'reset', <enter> should fix it.
its pretty easy to fix i just had to close the terminal and run it again, i just wanted to know what was going on... the symbols you are seeing correspond directly to chars..
Last edited by golfadas (2009-03-05 19:54:27)
Offline
Pages: 1