How to read binary(data) file generated by Fortran in C/C++?# Computation - 科学计算
M*n
1 楼
How to read binary(data) file generated by Fortran in C/C++?
Is it possible? If possible how to realize it?
The binary file generated by Fortran is a double precision data file.
I have tried to use read binary file in C++, but have problem. The following
is my C++
code.
double temp=0.0;
ifstream File("bin.data",ios::in|ios::binary);
File.read((char *) &temp, sizeof(double));
cout< The number that has been read out does not make any sense.
Anybody know why? Thanks.
Is it possible? If possible how to realize it?
The binary file generated by Fortran is a double precision data file.
I have tried to use read binary file in C++, but have problem. The following
is my C++
code.
double temp=0.0;
ifstream File("bin.data",ios::in|ios::binary);
File.read((char *) &temp, sizeof(double));
cout<
Anybody know why? Thanks.