Hi Alek,
One approach to try is to read the file as an unformatted
direct access file with a record length of 1.
If that fails, you may have to do something "nonportable".
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
On Mon, 26 Jul 2004 16:56:04 -0400, Aleksandar Donev
<[log in to unmask]> wrote:
>Hi,
>
>A simple unformatted IO question (I am sure the answer must be simple).
>How do I read a file of unformatted integers one by one, in a do loop?
>That is, this is a grayscale image where the pixel values (0-256,
>unsigned char's in C) are stored in one file without any spaces or
>newlines or such. I want to avoid reading them all at once into an
>array (it is a large file), and don't know how to do "nonadvancing"
>unformatted input. I know that I have to take care of unsigned/signed
>conversion myself.
>
>Thanks,
>Aleksandar
|