Originally Posted by
Abstracticus
I guess people on Windows wouldn't be able to edit the contents of their files, but I've been having no trouble at all on Linux Mint.
That makes no sense. Remember that even if you open a file in "binary" mode, if you output with fprintf you aren't really writing binary data! Binary data is written like this:
Code:
FILE *fp = fopen("afile", "wb");
int n = 123456789;
int m = 987654321;
fwrite(&n, sizeof n, 1, fp);
fwrite(&m, sizeof m, 1, fp);
fclose(fp);
Try editing that!!!
It would be read like this:
Code:
FILE *fp = fopen("afile", "rb");
int n, m;
fread(&n, sizeof n, 1, fp);
fread(&m, sizeof m, 1, fp);
fclose(fp);
printf("n=%d m=%d\n", n, m);