How come:-
unsigned long lFrames;
FILE *fp;
fp = fopen("data.dat", "rb");
fread(&lFrames, sizeof(unsigned long), 1, fp);
fclose(fp);
Doesn't work?
How come:-
unsigned long lFrames;
FILE *fp;
fp = fopen("data.dat", "rb");
fread(&lFrames, sizeof(unsigned long), 1, fp);
fclose(fp);
Doesn't work?
It works for me. Are you sure the number is stored as an unsigned long in the file and not a character. If the number is stored as characters, your code will read sizeof(long) characters from the file which will not be what your looking for.