home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!gatech!ukma!daffodil!wyvern!alpha
- From: alpha@wyvern.twuug.com (Joe Wright)
- Subject: Re: HELP !! Converting non printable characters to HEX
- Message-ID: <1992Sep3.134827.18049@wyvern.twuug.com>
- Organization: Box 68621, Virginia Beach, 23455
- X-Newsreader: Tin 1.1 PL4
- References: <1992Sep1.152149.1905@cs.uow.edu.au>
- Date: Thu, 3 Sep 1992 13:48:27 GMT
- Lines: 15
-
- u8705957@cs.uow.edu.au (Hitesh Sanghvi) writes:
- : Hi there;
- : Any suggestion or 'c' code on how to convert non printable
- : characters to hex.
- : My function works for printable ascii characters but does not work
- : on non printable characters.
- :
- ctoh(c, h) char *c, *h; {
- static char a[] = "0123456789ABCDEF";
- *(h+1) = a[*c & 017];
- *h = a[*c >> 4 & 017];
- }
-
- --
- Joe Wright alpha@wyvern.twuug.com
-