I'm trying to translate at short code snippet Delphi code to C#. Something
that shouldn't be to hard, but I directly turned into a problem that
probably is very simple. Here's the code that I'm wondering about
dbl : double;
....
BlockRead( TheFile, dbl, sizeof(dbl) );
....
All I want to read is a double from a binary file. In C# I wrote:
FileStream fs = new FileStream( fullName, FileMode.Open, FileAccess.Read );
BinaryReader r = new BinaryReader(fs);
....
double dbl = r.ReadDouble();
The value I get from doing this is not what I suspect at all. I've
discovered that reading string need to be done through a UTF7Encoder to work
correctly. My problem might have to to with sometinhg similar here, but how?
( I think I'm sure that I am at the right position before the reading.)
Any ideas would be appriciated!
Thanks/
Tomas