home *** CD-ROM | disk | FTP | other *** search
- /* float to float conversion with buffer--useful sometimes
- * ftofbuff < infile > outfile
- */
- #include <stdio.h>
- #include <fcntl.h>
- #include <io.h>
- #define BUFFSIZE 512 /* this buffsize requires larger stack,
- e.g., cl /F5000 ftofbuff.c */
-
- main()
- {
- float x[BUFFSIZE];
- int numread, i;
- setmode(fileno(stdin), O_BINARY);
- setmode(fileno(stdout), O_BINARY);
-
- while (numread = fread((char *)x, sizeof(float), BUFFSIZE, stdin))
- fwrite((char *)x, sizeof(float), numread, stdout);
- }