1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-11-10 00:30:35 +00:00

Exercise 1-6 and 1-7. expression = 1, and EOF = -1

This commit is contained in:
Kris Lamoureux 2021-11-05 21:17:39 -04:00
parent 7099cc732e
commit 979467565f
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

View File

@ -1,10 +1,12 @@
#include <stdio.h> #include <stdio.h>
/* copy input to output; 2nd version */ /* Exercise 1-6 and 1-7 */
int main() int main()
{ {
int c; int c;
while ((c = getchar()) != EOF) printf("EOF = %d\n", EOF);
putchar(c);
while (c = getchar() != EOF)
printf("c = %d\n", c);
} }