There are three problems with that code:
1) multiple calls to fwrite instead of a single call as frob mentions.
2) fopen/fclose are horribly slow on most platforms due to permission checks and all that, you really want all the data (and your files) in a single big archive file which you just keep open.
3) just "omg" I want to run and hide after seeing that.
Ignoring 1 and 2 for the time being, even with C you can simplify all of that by writing at worst a macro. Macro's may be evil but they will save you huge amounts of typing and possibility of error:
#define WRITE_ITEM( type, item ) _fwrite_nolock((unsigned char*)item, 1, sizeof(type....... blah blah.......
That's just scary code to see all those casts and sizeofs written out over and over.
Worrying about #1 and #2 are not worth discussion at this time.