mirror of
https://github.com/krislamo/knrc.git
synced 2024-11-10 00:30:35 +00:00
Example of a cleaner IO implementation
This commit is contained in:
parent
dcdc220259
commit
7099cc732e
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user