The popen function is similar to system, except it also calls pipe and creates a pipe to the standard input or from the standard output of the program, but not both.
#include <stdlib.h>
int main ()
{
int return_value;
return_value = system ("ls -l /");
return return_value;
}