1
0
mirror of https://github.com/krislamo/knrc.git synced 2024-09-19 21:00:35 +00:00

Example of a cleaner IO implementation

This commit is contained in:
Kris Lamoureux 2021-11-05 21:01:14 -04:00
parent dcdc220259
commit 7099cc732e
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925

View File

@ -1,13 +1,10 @@
#include <stdio.h>
/* 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();
}
}