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 22:37

There has been egregious misuse of the term deterministic in this shitty /g/ infiltrated thread, I'm going to leave a definition here to clarify for posterity.

Deterministic algorithms can be defined in terms of a state machine, if the machine is deterministic, its current state determines what its next state will be; its course through the set of states is predetermined.

Sufficient for non-determinism:
Never Terminates: NO (States are still correctly determined)
Potentially interruptable: NO (The signal is considered input to the state machine)
Accepts user input: NO (as above)
Invokes undefined behavior: YES (Machine may draw numbers out of a hat to determine next state)
Invokes unspecified behavior: YES (The same machine may produce different output on identical runs)
Invokes implementation defined behavior: YES (In terms of the abstract machine, conforming implementations may produce different results on the same input)

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