I haven't heard from anyone on this problem. Does anyone have an idea what
would cause this behaviour?
73,
Chuck
N1SPX
-----Original Message-----
From: Charles W. Doolittle, N1SPX <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday, August 29, 1998 1:55 AM
Subject: Problem w/binary read istream::read
>Hi all - have the following code snippet
>
>#include <iostream.h>
>..
> ifstream is("menu.dat", ios::binary|ios::nocreate);
> while ( is.good() ) {
>// Read a record in, then add it to the menu
> is.read((char*)&item1, sizeof(menu_item));
>...
>
>however, item1 never gets changed when that line is run, and a is.rdstate
>returns 3. also, it only does one loop, so when it hits the is.good check
>the 2nd time, it falls out. I know that the file has more than enough data
>to prevent reaching eof. It was written w/2 calls to
> os.write((char*)&item1, sizeof(menu_item));
>
>I am at a loss. I have also tried to replace the menu_item (name of class)
>w/ item1 to no avail.
>
>
>
>73,
>Chuck
>N1SPX
>