Erik Leunissen <e.leunissen@xxxxxxxxx> writes: > I would like to compile C code by feeding it to gcc (or cc) from > stdin, instead of specifying an input file. What I want would result > in a command line like: > > echo "ThisWouldNeedToBeCcode" | gcc -o out.o In gcc 4 you can do this: echo 'int main() { printf ("Hello, world\n"); }' | gcc -xc - -o out The '-' tells gcc to read stdin. The '-xc' tells gcc that the input is in C (rather than, say, C++). Ian