People download images with watermarks instead of writing this.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

24 lines
701B

  1. /* ascii.c - The ASCII Table
  2. * @BAKE cc $@ -o $* $+
  3. */
  4. #include <stdio.h>
  5. #include <uchar.h>
  6. int main(void)
  7. {
  8. unsigned int c;
  9. const char codes[32][4] =
  10. { "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "TAB", "LF",
  11. "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK",
  12. "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" };
  13. puts(" DEC HEX OCT");
  14. for (c = 0; c < 127; ++c) {
  15. if (c == 127)
  16. { printf( "DEL %4u %4x %4o\n", c, c, c); }
  17. else if (c > 31)
  18. { printf("'%c' %4u %4x %4o\n", (char16_t) c, c, c, c); }
  19. else
  20. { printf( "%3s %4u %4x %4o\n", codes[c], c, c, c); }
  21. }
  22. }