Original Post
I''m having trouble with fwrite not writing anything. Observe:
//Open file
FILE *filePoint = fopen("test.dat", "wb");
if (filePoint == NULL) return false;
//Write
int data = 5;
if (fwrite(&data, sizeof(int), 1, filePoint) != 1) return false;
//Close File
fclose(filePoint);
This is inside another function, by the way, hence the returns on the error checking.
filePoint is non null on the fopen, so according to the docs the file opens properly. fwrite returns 1, so according to the docs that means 1 item was written to the file.
The problem is, the file it writes to is empty after this code runs (and yes, I''m sure it''s getting run in the first place. I debugged through it).
What the hell is going on???