Created
May 11, 2013 01:39
-
-
Save scvalex/5558578 to your computer and use it in GitHub Desktop.
A useful test for people who claim to know C: What does this program print? The answer requires a basic understanding of `stdio` and the semantics of forking. The answer is in the comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
int main(int argc, char *argv[]) { | |
printf("Hello, "); | |
fork(); | |
printf(" World!\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Build and run: