Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- FILE *fin, *fout;
- char infile[]="binary.raw";
- char outfile[]="binary.raw";
- double x;
- if ((fin=fopen(infile, "rb"))==NULL) {
- fprintf(stderr, "Data file open error.\n");
- return 1;
- }
- if ((fout=fopen(outfile, "wb"))==NULL) {
- fprintf(stderr, "Result file open error.\n");
- fclose(fin);
- return 1;
- }
- while (fread(&x, sizeof(double), 1, fin) > 0) {
- fprintf(fout, "%5.4f\n", x);
- }
- fclose(fin);
- fclose(fout);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement