mirror of
https://github.com/krislamo/knrc.git
synced 2025-01-05 19:10:36 +00:00
Exercise 1-6 and 1-7. expression = 1, and EOF = -1
This commit is contained in:
parent
7099cc732e
commit
979467565f
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user