C examples for Function:Utility Function
Use the system() function to execute system command
#include <stdio.h> #include <stdlib.h> int main( void ) { char input[40]; while (1){/*from w ww. ja v a 2 s .c om*/ puts("\nInput the desired system command, blank to exit"); gets_s(input); /* Exit if a blank line was entered. */ if (input[0] == '\0') exit(0); /* Execute the command. */ system(input); } return 0; }