XCODE ASCII

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Original von below
    2) Wie ich schon sagte hängt das, was Du siehst stark davon ab, wie das Terminal, an dem Du es ausgibts das interpretierst


    Jip.

    Hier mal ein kleines Beispiel:

    Quellcode

    1. #include <stdio.h>
    2. main()
    3. {
    4. short int ordnungszahl = 32;
    5. char zeilenzahl;
    6. for(zeilenzahl = 1; zeilenzahl < 14; zeilenzahl++)
    7. {
    8. for(ordnungszahl; ordnungszahl < 256; ordnungszahl = ordnungszahl + 16)
    9. {
    10. printf("%3c %3c %3c %3c %3c %3c %3c %3c %3c %3c %3c %3c %3c %3c %3c %3c\n", ordnungszahl, ordnungszahl + 1, ordnungszahl + 2, ordnungszahl + 3, ordnungszahl +4, ordnungszahl + 5, ordnungszahl + 6, ordnungszahl + 7, ordnungszahl + 8, ordnungszahl + 9, ordnungszahl + 10, ordnungszahl + 11, ordnungszahl + 12, ordnungszahl + 13, ordnungszahl + 14, ordnungszahl + 15);
    11. zeilenzahl ++;
    12. }
    13. }
    14. }
    Alles anzeigen


    (wegen der Prüfung der FOR-Schleife gibt es hier keinen unsigned char, der kann ja nur bis 255)

    Das gibt bei meinem Terminal folgende Ausgabe:

    Quellcode

    1. g5:~/Documents/Tests ldv$ gcc char_test.c
    2. g5:~/Documents/Tests ldv$ ./a.out
    3. ! " # $ % & ' ( ) * + , - . /
    4. 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
    5. @ A B C D E F G H I J K L M N O
    6. P Q R S T U V W X Y Z [ \ ] ^ _
    7. ` a b c d e f g h i j k l m n o
    8. p q r s t u v w x y z { | } ~
    9. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    10. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    11. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    12. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    13. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    14. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    15. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    16. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    Alles anzeigen


    Gehe ich jetzt auf Terminal->Fenstereinstellungen - [Darstellung] - Zeichensatzcodierung [Westeuropäisch (ASCII)] sieht das Ganze wie folgt aus:

    Quellcode

    1. g5:~/Documents/Tests ldv$ ./a.out
    2. ! " # $ % & ' ( ) * + , - . /
    3. 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
    4. @ A B C D E F G H I J K L M N O
    5. P Q R S T U V W X Y Z [ \ ] ^ _
    6. ` a b c d e f g h i j k l m n o
    7. p q r s t u v w x y z { | } ~
    8. ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ® ¯
    9. ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
    10. À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
    11. Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
    12. à á â ã ä å æ ç è é ê ë ì í î ï
    13. ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
    Alles anzeigen
    «Applejack» "Don't you use your fancy mathematics to muddle the issue!"

    Iä-86! Iä-64! Awavauatsh fthagn!

    kmr schrieb:

    Ach, Du bist auch so ein leichtgläubiger Zeitgenosse, der alles glaubt, was irgendwelche Typen vor sich hin brabbeln. :-P