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

  1. # include "stdio.h"
  2. double readfloat(fd)
  3. FILE *fd;
  4. {
  5.     char r[30];
  6.     double atof(),ff;
  7.     int counter,d;
  8.  
  9. J00100:    d=getc(fd);
  10.     if (d==13 || d==10)
  11.             goto J00100;
  12.     r[0]=d;
  13.     counter=1;
  14.  
  15. J00200: d=getc(fd);
  16.     if (d<32)
  17.             goto J00300;
  18.     r[counter++]=d;
  19.     goto J00200;
  20.  
  21. J00300: r[counter]=0;
  22.     ff=atof(r);
  23.     return(ff);
  24. }