C-Execute-Command

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Dec 2 18:31:33 AEST 1989


In article <2615 at servax0.essex.ac.uk> georg at essex.ac.uk writes:
>            Does anybody know how to call an executable file from
>                               a c-program ?
>                      I am using the Unix-CC copiler.

The simplest method is to invoke the system() library function.
If your program needs to provide input to, or capture output from,
the command, then popen() should be used.
If you need to do something more elaborate then you need to study
UNIX system programming; Kernighan & Pike's "The UNIX Programming
Environment" is recommended.



More information about the Comp.lang.c mailing list