これをコンパイルしました(gccコンパイラ):
#include< stdio.h>
main() {
unsigned char ch;
FILE *fp;
fp=fopen("trial","r");
while((ch=getc(fp))!=EOF)
printf("%c",ch);
fclose(fp);
}
それは以下を与える:
Warning: comparison is always true due to limited range of the data type
実行すると、文字の無限のストリームが端末に出力されます。(プログラムをコンパイルする前に「trial」という名前のファイルを作成し、ファイルにテキストを書き込んだと仮定します。)
警告を教えてください.....