1) If you just want to execute a program, wait for it to finish, then continue your program:
Use
system()
2) If you want to start a program that runs on its own while your program also continues to run:
Use
fork() in combination with
execvp()
3) If you want to run a program and read from its stdout into your program (or write to its stdin from your program) through a pipe:
Use
popen()
See these man pages for more information:
man 3 system
man 2 fork
man 3 execvp
man 3 popen
If necessary, google for examples. One site that deals with this among other things, is the freely downloadable book (as PDF's + seperate sample code) "Advanced Linux Programming" (New Riders). Check
http://www.advancedlinuxprogramming.com/