diff options
author | erdgeist <> | 2007-10-17 11:52:41 +0000 |
---|---|---|
committer | erdgeist <> | 2007-10-17 11:52:41 +0000 |
commit | 60fde85b647fcc006b67d0a6a8f5e185dd6b66eb (patch) | |
tree | f75def174ab723c48b7d9c981bc90cbddb15443d /src | |
parent | cfc72d1e3bd2c9400fecc539bb4a13d5a6603fe3 (diff) |
hex Out\!
Diffstat (limited to 'src')
-rw-r--r-- | src/hexout.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hexout.c b/src/hexout.c new file mode 100644 index 0000000..1af6805 --- /dev/null +++ b/src/hexout.c | |||
@@ -0,0 +1,13 @@ | |||
1 | #include <stdio.h> | ||
2 | |||
3 | int main() { | ||
4 | char tbl[] = "0123456789ABCDEF"; | ||
5 | int in; | ||
6 | |||
7 | while( ( in = getchar() ) != EOF ) { | ||
8 | putchar( tbl[in>>4]); | ||
9 | putchar( tbl[in&15]); | ||
10 | putchar( '\n' ); | ||
11 | } | ||
12 | return 0; | ||
13 | } | ||