3 ms·
> fgetc() does not return 'char', it returns 'int' else EOF won't fit. Or more precisely: don't store the return value in a 'char' and check if it is EOF. On s
by st_goliath 4y ago
> fgetc() does not return 'char', it returns 'int' else EOF won't fit.
Or more precisely: don't store the return value in a 'char' and check if it is EOF. On some platforms (e.g. gcc ARM eabi), regular 'char' is unsigned and the check fails.