Skip to content

Instantly share code, notes, and snippets.

@karlredgate
Created November 19, 2022 18:55
Show Gist options
  • Save karlredgate/d58ecebfa64298a53d3a71b5eec89c5d to your computer and use it in GitHub Desktop.
Save karlredgate/d58ecebfa64298a53d3a71b5eec89c5d to your computer and use it in GitHub Desktop.
Compile a Quick C Program without Editing

Compile a Quick C Program without Editing

This is a dumb(cute) hack to compile a simple program directly, without editing and managing the source code in a file.

ln -s /dev/tty foo.c
cc foo.c
#include <stdio.h>
int main() { printf("hello\n"); }
^D
./a.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment