I haven't programmed in a while and I am trying to make a simple flashcard type program to drill myself on a foreign language.
However for the open file function, to open the flashcard text files, it keeps throwing an Illegal Op. message in Kernel32.dll. Here is the function, which I know is where the problem is at least occuring, if not the only place with trouble.
Specifically I have narrowed the fault down to the last fseek() function, if that helps.
void OpenCards(HWND hwnd, char *filename)
FILE *file = NULL;
fpos_t length = 0;
char *buff = NULL;
file = fopen(filename,"rt");
MessageBox(hwnd,"Couldn't load file!","Error",MB_OK | MB_ICONERROR);
buff = new char[(int)length + 1];
MessageBox(hwnd,"Couldn't load OurFile.txt","Error",MB_OK | MB_ICONERROR);
fseek(file,0,SEEK_SET); //this is where the fault is
buff[(int)length] = NULL;