Advertisement
Guest User

printf impurity

a guest
Aug 12th, 2012
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. ~$ cat test.c
  2. #include <stdio.h>
  3.  
  4. int main(int argc, const char** argv)
  5. {
  6. int n;
  7. n = printf("value\n");
  8. fprintf(stderr, "n: %d\n", n);
  9. fclose(stdout);
  10. n = printf("value\n");
  11. fprintf(stderr, "n: %d\n", n);
  12. }
  13.  
  14. ~$ ./test
  15. value
  16. n: 6
  17. n: -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement