home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / code_examples / librar / hex2file.c < prev    next >
Text File  |  1989-02-08  |  523b  |  24 lines

  1. /*--------------------------------------*/
  2. /*                    */
  3. /*           HEX2FILE(X,X)        */
  4. /*                    */
  5. /* Writes a number to a file in hex for-*/
  6. /* mat. The first argument is the file    */
  7. /* descriptor and the second is the     */
  8. /* number to write.            */
  9. /*                    */
  10. /*      Written by John Callicotte    */
  11. /*                    */
  12. /*--------------------------------------*/
  13. # include "stdio.h"
  14. void hex2file(fd,a)
  15. int a;
  16. FILE *fd;
  17. {
  18.         int d,e;
  19.         e=a/256;
  20.         d=a-256*e;
  21.         putc(e,fd);
  22.         putc(d,fd);
  23. }
  24.