I'm working in C and trying to read a file system image (eg: name.IMA) and I need it in binary form because I need to read it byte by byte. What is the correct way to read these type of files in C? The below does not work:
FILE *filePointer = fopen("name.IMA","rb");
fread(buffer, fileLength, 1, filePointer);
MAIN PROBLEM: The fread() is actually opening and reading as expected. The confusion is because of the return value given by fread() is for some reason equal to 1 (even though way more than 1 byte was read). What's the issue here?