I wrote a code in C to read a character from external .txt file. The codes are given below.
#include<stdio.h>
void main()
{
FILE *in;
unsigned char ch;
in=fopen("file.txt","r");
while((ch=fgetc(in))!=EOF)
{
printf("%c",ch);
}
}
after campile it gave the warning :
(ch=fgetc(in))!=EOF) is always true and would be in infinite loop.
But when I removed the unsigned declaration of ch it works fine.
Please, tell me , Why did it give me Warning like that ?