Skip to content

Instantly share code, notes, and snippets.

@WingTillDie
Created July 16, 2023 21:25
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 WingTillDie/9fa6dcd66b8a15ceeb927cc766124d51 to your computer and use it in GitHub Desktop.
Save WingTillDie/9fa6dcd66b8a15ceeb927cc766124d51 to your computer and use it in GitHub Desktop.
Run C++ as script by gcc, tcc, clang
#if 0
gcc -x c++ "$0"
if [ $? -eq 0 ]; then
./a.out "$@"
fi
exit
clang -x c++ "$0"
if [ $? -eq 0 ]; then
./a.out "$@"
fi
exit
tcc -run "$0" "$@"
exit
#endif
int main(){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment