Skip to content

Instantly share code, notes, and snippets.

@yoh2
Created March 7, 2019 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoh2/25caf378a647a82d59c6882d505b65f8 to your computer and use it in GitHub Desktop.
Save yoh2/25caf378a647a82d59c6882d505b65f8 to your computer and use it in GitHub Desktop.
ループも再帰も使わず (ある意味再帰ではあるが) Hello, World! を出力し続ける上にめっちゃ止めにくいやつ。
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
puts("Hello, World!");
if(fork() == 0)
{
execlp(argv[0], argv[0], (const char *)NULL);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment