Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

For you

Name: Anonymous 2012-01-12 14:20

What is the output of this program and why?

#include <stdio.h>

void f(void) {
  printf("hax my anus\n");
  fflush(stdout);
  f();
}

int main(void) {
  f();
  return 0;
}

Name: Anonymous 2012-01-12 16:28

5.1.2.3 states that

The least requirements on a conforming implementation are:
...
- At program termination, all data written to files shall be identical to the result that execution of the program according to the abstract semantics would have produced.
...


Since stdout is a FILE *, that means that any conforming C implementation must allow this program to loop until you interrupt it with a signal or something to that effect.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List