This topic is now archived and is closed to further replies.

struct and binary file

This topic is 6280 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
"better" is in the eye of the beholder. tagplayer is unlikely to have any padding so the effort to eliminate it is wasted.

Even if padding was there, your first example (single fwrite) has less code and is arguably easier to understand. Also, copying whole structures with a single memcpy can be faster than copying every member individually even taking the padding into account.


Share this post

Link to post
Share on other sites