(FPU) EXTENDED type read by C program
Quote:
> I have a problem when reading a bynary file written by a program written
> with delphi pascal and in compiled in Borldand platform.
> I am using MS visual C++ but when I attempt to read extended types
> (floating point numbers) (10 bytes) into long double this operation goes
> wrong.
The problem is most likely that most C compilers store the extended
type in 12 bytes (GCC does so anyway). Try writing the extended values
using something like
type
extrec = record
value: extended;
dummy: word;
end;
var
f: file of extrec;
e: extrec;
begin
...
e.value := 1.0:
e.dummy := 0;
write(f,extrec);
...
end.
Since extended is not an official IEEE format (like you said), it's
possible that Visual C has a special type (like TP) that maps to
extended, otherwise it's probably a "long double".
Jonas