diff --git a/04-file-copying.c b/04-file-copying.c index 5c7e6f2..a5e7e92 100644 --- a/04-file-copying.c +++ b/04-file-copying.c @@ -1,13 +1,10 @@ #include -/* copy input to output; 1st version */ +/* copy input to output; 2nd version */ int main() { int c; - c = getchar(); - while (c != EOF) { + while ((c = getchar()) != EOF) putchar(c); - c = getchar(); - } }