diff --git a/chapter-01/2-character-io/Makefile b/chapter-01/2-character-io/Makefile new file mode 100644 index 0000000..abe7f13 --- /dev/null +++ b/chapter-01/2-character-io/Makefile @@ -0,0 +1,2 @@ +all: + gcc -o character-io.x86_64 main.c diff --git a/chapter-01/2-character-io/main.c b/chapter-01/2-character-io/main.c new file mode 100644 index 0000000..d1dc013 --- /dev/null +++ b/chapter-01/2-character-io/main.c @@ -0,0 +1,11 @@ +#include + +void main() +{ + int c; + + while ((c = getchar()) != EOF) { + putchar(c); + printf("%d", EOF); + } +}