Hi everyone, i have this portion of code
while(c = getc(file) != EOF)
c is an int and file is a FILE *file = fopen(filename, "r");
The filename points to a file with 2 lines, 10 characters total. That while always makes c a value of 1 (accodring to ASCII -> start text, dunno what that mean).
But when i use this while:
while((c = getc(file)) != EOF)
It works perfect. I though that was equivalent...i'm missing something on basic syntax here. What's wrong in the first while?
Thank you.