C
carnie
I have a BookData data structure that I'm trying to set up for file io. I
open a file for random access io (same file for input and output), and
write and read to the file with the following code.
BookData book;
long pos;
getBook(&book);
fstream data_file("books.dat",ios::in|ios:ut);
pos = LookUpBook(book) - sizeof(book);
data_file.write((char *)&book,sizeof(book));
The problem is that no changes I make to the variable book are reflected in
the file. I'm using gcc 3.2.3 on a gentoo linux platform wit Reiser fs, if
that makes any difference. Any and all help is appreciated.
carnie
open a file for random access io (same file for input and output), and
write and read to the file with the following code.
BookData book;
long pos;
getBook(&book);
fstream data_file("books.dat",ios::in|ios:ut);
pos = LookUpBook(book) - sizeof(book);
data_file.write((char *)&book,sizeof(book));
The problem is that no changes I make to the variable book are reflected in
the file. I'm using gcc 3.2.3 on a gentoo linux platform wit Reiser fs, if
that makes any difference. Any and all help is appreciated.
carnie