Sometimes, when I open the a file like so:
FILE *file = fopen(fname, "wb");
if(!file) printf("Error code: %d\n",ferror(file));
I get a result of 32. What does this mean? Specifically, for eMbedded Visual C++ 4.0
Also, it seems like eVC does not support perror/errno :(
You are using ferror() in a wrong way: it works only on a valid (non-null) file handle. Passing it NULL (in the case fopen() fails) causes UB, which manifests in your case by printing a random value (not trapping on NULL pointer access suggests that the underlying platform does not have memory protection).