Advertisement
paulogp

ASCII

Jul 13th, 2011
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. // Apple Xcode
  2. // paulogp
  3.  
  4. /* ASCII table */
  5.  
  6. //  main.c
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <time.h>
  10.  
  11. int main (int argc, const char * argv[]) {
  12.     // ascii
  13.  
  14.     // this will print the character value of that number (ASCII)
  15.     // M1: convert inside print
  16.     // M2: convert before print
  17.     char the_c_val;
  18.  
  19.     for (int the_ascii_val = 48; the_ascii_val <= 90; the_ascii_val++) {
  20.         the_c_val = (char)the_ascii_val;
  21.         printf("%i - M1: %c  M2: %c\n", the_ascii_val, the_ascii_val, the_c_val);
  22.     }
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement