1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-09-19 21:00: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>
/* 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);
}