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

  1. /*--------------------------------------*/
  2. /*                    */
  3. /*            FILE2HEX(X)        */
  4. /*                    */
  5. /* Reads and returns a number from a    */
  6. /* file. The argument is the file desc- */
  7. /* riptor.                */
  8. /*                    */
  9. /*      Written by John Callicotte    */
  10. /*                    */
  11. /*--------------------------------------*/
  12. # include "stdio.h"
  13. file2hex(fd)
  14. FILE *fd;
  15. {
  16.         int c,d,e;
  17.         c=getc(fd);
  18.         d=getc(fd);
  19.         e=256*c+d;
  20.         return(e);
  21. }
  22.