Well, you treat binary files (almost) the same as you would any other type of file. If you use
, just add that little "
" in the mode to tell it you're working in straight binary mode (see here
As far as handling it within your code once the file is open, well, you have to know how many bytes to read at a time... then you essentially cast those bytes onto something that makes sense and interpret them. This can be done in a few different ways. See documentation for fgets
] and fread
To write in binary, it's pretty much the same thing as reading but in reversed order.
Take variables and load them to buffer bytes->Open file in binary mode to write->Write out your buffered data
Hope this at least kicks you in the right direction... happy coding.