I don't understand why i get this strange result by this function with some files.
For example if i have a
input.txt
and inside of it there is a string like
abcd
if i do something like:
FILE* file = fopen("intput.txt", "r"); char currentChar; long n = ftell(file); //return 0 it's ok fread(¤tChar, sizeof(char), 1, file); long n = ftell(file); // return 1 it's ok Now if i do the same things but with a (for example) .png file i have different result:
FILE* file = fopen("intput.png", "r"); char currentChar; long n = ftell(file); //return 0 it's ok fread(¤tChar, sizeof(char), 1, file); long n = ftell(file); // return 216 why return 216 and not 1 I don't understand why with the input.png file i get 216 instead of 1
FILE* file = fopen("intput.png", "rb");and alsolong nredefinition.