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
I also faced this kind of problem. So this is my solution.
fwrite(val, sizeof(val[0], sizeof(val)/sizeof(val[0]), fp);