fgetc returns int, so using char to store the result even before you are sure it could be stored there -just asking for troubles.Code:char ch; while ((ch=fgetc(in))>0)
On compiler where char is unsigned - you'll be unable to determine the EOF condition
On compilers where char is signed - you'll be unable to read chars from the 128-255 range