adding first example of character I/O
This commit is contained in:
parent
58c1b78744
commit
da6efffb56
2
chapter-01/2-character-io/Makefile
Normal file
2
chapter-01/2-character-io/Makefile
Normal file
@ -0,0 +1,2 @@
|
||||
all:
|
||||
gcc -o character-io.x86_64 main.c
|
11
chapter-01/2-character-io/main.c
Normal file
11
chapter-01/2-character-io/main.c
Normal file
@ -0,0 +1,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void main()
|
||||
{
|
||||
int c;
|
||||
|
||||
while ((c = getchar()) != EOF) {
|
||||
putchar(c);
|
||||
printf("%d", EOF);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user