I need to write data to a binary file using C\'s I/O functions. The following code causes a runtime exception :
#include \"stdio.h\" int main(int argc,char
Adding to Neil's answer: this works when you are reading and writing the file on the same platform. Things can become weird if you are reading/writing across platforms with different endianness.