Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Printing the last item of a structure twice
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="James Kanze, post: 3910735"] That's certainly one problem, but Jonathan is also right. You can't use fread and fwrite (nor istream::read and istream::write) on the structure you've defined. If it works, it's only by chance. In general, binary dumps of anything but char only work within the same process---you can't reread the data from code compiled with a different compiler, or sometimes different version of the same compiler or with different compiler options. And even within the same process, you're restricted to PODs without pointers. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Printing the last item of a structure twice
Top