wyatt8740

hex2ascii.c - converts hex input to text output on terminal.

Oct 12th, 2014
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.68 KB | None | 0 0
  1. /*  hex2ascii - yet another hex to text program
  2.     Despite the name, this should work on other encodings than ascii.
  3.     I, Wyatt Ward, this program's author, release this program into the
  4.     public domain.
  5.     Usage: hex2ascii 74 68 65 20 71 75 69 63 6b 20 62 72 6f 77 6e 20 66 6f 78 20 6a 75 6d 70 65 64 20 6f 76 65 72 20 74 68 65 20 6c 61 7a 79 20 64 6f 67 2e
  6.     should print "the quick brown fox jumped over the lazy dog." */
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. int main(int argc,char *argv[]){
  11.         char *end;
  12.         int j;
  13.         for(j=0;j<argc;j++){
  14.                 printf("%c",strtol(argv[j],&end,16));
  15.         }
  16.         printf("\n");
  17.         return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment