Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int c;
- while ((c = getchar()) != EOF){
- putchar(c);
- }
- }
- hello world
- hello world
- #include <stdio.h>
- int main()
- {
- int c,b;
- /* printf(EOF); Segmentation fault (Core dumped) */
- while (b = ((c = getchar()) != EOF)){
- printf("Bool: %dn", b);
- putchar(c);
- }
- }
- hello world
- Bool: 1
- h
- Bool: 1
- e
- Bool: 1
- l
- Bool: 1
- l
- Bool: 1
- o
- Bool: 1
- Bool: 1
- w
- Bool: 1
- o
- Bool: 1
- r
- Bool: 1
- l
- Bool: 1
- d
- Bool: 1
Add Comment
Please, Sign In to add comment