I get an error on this line: fscanf(file,"%s",sprite_filename); that I don't have access to write to 0x0041ed5b. I'm guessing that's the address of sprite_filename, since the only other variable on that line is file, and we're not writing to it. Why am I getting this error? If I declare char* sprite_filename = ""; , shouldn't I have access to it within the same set of code brackets?

>> since the only other variable on that line is file, and we're not writing to it.

Oh but yes you are. file is supposted to be a pointer to an open FILE object.

>>sprite_filename
You have not allocated any memory for fscanf() to save the characters. Needs to be either allocated with new or statically allocated char *sprite_filename = new char[255]; // Or this char sprite_filename[255];

>>Oh but yes you are. file is supposted to be a pointer to an open FILE object.
I am writing to file? Aren't I just reading from it? file is declared as FILE* in another part of the code. And I double-check, the address with the issue is indeed sprite_filename.

>>when coming from C background
I actually don't come from a C background. C++ was actually the very first programming language I learned (took me a while to understand all of it though, i.e. classes, pointers). I just think the whole idea of using the shift operators to get input, because left and right shifting have nothing to do with getting input or putting output to a stream.

Also, is there a way to check if the end of a file has been reached with ifstream? Because I'm using feof() in my program.