HI,
How to execute any DOS command like"print abc.txt" in a C program
friendz help me ? awating 4 u r answers....
Thank u in advance !
HI,
How to execute any DOS command like"print abc.txt" in a C program
friendz help me ? awating 4 u r answers....
Thank u in advance !
Hi,
I am also beginner in C, but this should work as I see:
#include <stdlib.h>
#include <stdio.h>
int main()
{
printf("Your command\n");
system("print abc.txt");
return 0;
}
system() function can help to execute your commands
If you want to capture the output of the command, redirect the output of the command into a file, then open that file, or look into the POSIX function popen().
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.