SHARE
TWEET

printf impurity

a guest Aug 12th, 2012 16 Never
  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
RAW Paste Data
Top