Exercise 1-6 Verify that the expression getchar() != EOF is 0 or 1.
source code
#include <stdio.h> int main() { int c; while( c = getchar() != EOF ) { putchar(c); } return 0; }
Exercise 1-7 Write a program to print the value of EOF.
source code
#include <stdio.h> int main() { printf(" %d \n " , EOF ); return 0; }
반응형
'프로그래밍 > C언어' 카테고리의 다른 글
1.5.2 Count Chracters 2st version (0) | 2011.11.23 |
---|---|
1.5.2 Count Chracters (0) | 2011.11.23 |
1.5.1 File Copying 2nd version (0) | 2011.11.07 |
1.5.1 File Copying (0) | 2011.11.07 |
1.5 Character Input and Output (0) | 2011.11.07 |