int system (const char* command);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* system example : DIR */
#include <stdio.h> /* printf */
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */
int main ()
{
int i;
printf ("Checking if processor is available...");
if (system(NULL)) puts ("Ok");
else exit (EXIT_FAILURE);
printf ("Executing command DIR...\n");
i=system ("dir");
printf ("The value returned was: %d.\n",i);
return 0;
}