From 979467565f99607f1d8e6b2260224939aeb7047d Mon Sep 17 00:00:00 2001 From: Kris Lamoureux Date: Fri, 5 Nov 2021 21:17:39 -0400 Subject: [PATCH] Exercise 1-6 and 1-7. expression = 1, and EOF = -1 --- 04-file-copying.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/04-file-copying.c b/04-file-copying.c index a5e7e92..7282464 100644 --- a/04-file-copying.c +++ b/04-file-copying.c @@ -1,10 +1,12 @@ #include -/* copy input to output; 2nd version */ +/* Exercise 1-6 and 1-7 */ int main() { int c; - while ((c = getchar()) != EOF) - putchar(c); + printf("EOF = %d\n", EOF); + + while (c = getchar() != EOF) + printf("c = %d\n", c); }