The function system() can be used for executing a DOS Command or Application from inside an executing program.
Exaple:
The above example program does display the output of the printf() function but the code line:Code:#include <stdio.h> #include <stdlib.h> void main() { printf("Listing the Directory Contents:\n"); system("dir"); printf("\nPress any key to exit from the program..."); getch(); exit(0); }
doesn't work.Code:system("dir");
Any help?