C
Chris
Hi,
What is the most easy way to check on EOF while reading a
binary file with all integers ?
In lot of examples the read data are first stored in a
string, and afterwards the string is checked on *null*
value, but that does not work for binary files.
Like this ...
string buf;
while ( (buf = file.ReadString()) != null)
{
(...)
}
I need something like
int tim;
while ( (tim = file.ReadSingle()) != null)
{
(...)
}
but that does not work, as *tim* is an integer, and cant be
checked on *null*.
Is there a separate function (so, not getting any data) in
C# for merely checking the end-of-file condition ?
Thanks,
Chris.
What is the most easy way to check on EOF while reading a
binary file with all integers ?
In lot of examples the read data are first stored in a
string, and afterwards the string is checked on *null*
value, but that does not work for binary files.
Like this ...
string buf;
while ( (buf = file.ReadString()) != null)
{
(...)
}
I need something like
int tim;
while ( (tim = file.ReadSingle()) != null)
{
(...)
}
but that does not work, as *tim* is an integer, and cant be
checked on *null*.
Is there a separate function (so, not getting any data) in
C# for merely checking the end-of-file condition ?
Thanks,
Chris.