Created
May 18, 2013 20:29
-
-
Save koturn/5605684 to your computer and use it in GitHub Desktop.
C言語のソースファイルを実行可能にした場合、コンパイル&実行できるように細工したもの。
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
#if 0 | |
src=$0 | |
exe=${src%.*} | |
gcc -s -O3 -pipe -Wall -Wextra -o $exe $src && $exe $@ | |
exit | |
#endif | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) { | |
printf("Hello World!\n"); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment