System function in C
System function in C – Used to run shell commands inside a C program.
/*:) system :) have fun */
// header files
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
//main func
int main(int argc ,char *argv[])
{
printf("running ps with system() function\n");
system("ps -ax &");
printf("done");
return 0;
}
Comments
Post a Comment