AnsweredAssumed Answered

read from file saved data in double Big Endian

Question asked by Milos on Mar 30, 2010
Latest reply on Aug 27, 2015 by MaheshN

Hi,

 

I've got the data which I want to use in Visual DSP

Data are in 'double 64bit IEEE' format saved in file.dat

for example

0.123456

is saved in file as

3FBF9ACFFA7EB6BF

it means in Big Endian

 

I would like to read it in Visual DSP

but "fread" read it incorrect

as

CF9ABF3F BFB67EFA

 

code for reading is

double read_items,    buffer[1];

FILE* fp = fopen("file.dat", "rb");

read_items = fread(&buffer, sizeof(double), 1, fp);

 

 

Can you help me?

 

I can save my data also in other way

'b' or 'ieee-be'

Big-endian ordering

'l' or 'ieee-le'

Little-endian ordering

's' or 'ieee-be.l64'

Big-endian ordering, 64-bit data type

'a' or 'ieee-le.l64'

Little-endian ordering, 64-bit data type

 

I try it but no way.

 

Milos

Outcomes