C言語の #if 0 を使ったおもしろ技
- 1 分で読めます - 34 文字$ cat ./hello.c
#if 0
gcc -o hello hello.c
./hello
exit
#endif
#include <stdio.h>
int main( void )pre {
printf( "Hello, World!\n");
return 1;
}
$ chmod +x hello.c
$ ./hello.c
Hello, World!
C言語なのにスクリプト言語のように実行できるところが面白いですね。