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:
parent
7099cc732e
commit
979467565f
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user