Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

printf impurity

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.25 KB  |  views: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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