The question is whether or not there is a same way to modify one of these records, even if I had 20? My thought was that having multiple strings, there's no way to tell the actual size of any given structure, and therefore the only way to update something would be to rewrite the entire file.
Or am I wrong in how binary files work, and to modify the second record, I can just do something like:
sizeof(Book) is constant. `std::string' holds a pointer that points to where the characters are allocated.
That said, it would be an error to do fileout.write( (char*)&book1, sizeof(book1) ); because the value of the pointer would be meaningless in another run of the program.
20 records is a really small value, you better just rewrite the whole file. However if that size increases consider using a database