Why can't I find the value of EOF in C?

前端 未结 6 856
梦毁少年i
梦毁少年i 2020-12-30 13:48

I\'m reading the book \"The C Programming Language\" and there is an exercise that asked to verify that the expression getchar() != EOF is returning 1 or 0. Now

6条回答
  •  悲&欢浪女
    2020-12-30 14:44

    make it c!=EOF instead. Because you want to print the result of the expression and not the character.

提交回复
热议问题