Correct me if Im wrong, but system(); will only do one command, so I cant do system("cd cow"), is there any function that will do this for me?
Correct me if Im wrong, but system(); will only do one command, so I cant do system("cd cow"), is there any function that will do this for me?
isnt there a way to pass stuff to the command line?
you can use argv and argc:
Code:main(int argc, char *argv[]) { /* code */ }
If this is Unix/Linux, then there is a family of functions called "exec". These functions take over a forked process, executing whatever code you put in the exec call in the new process space. I may be mistaken, but I think this is basically what system() winds up doing.
starX
www.axisoftime.com
you can use multiple commands in one statement to system by using semicolons
system("cd cow ; cat udders | lpr ; rm udders");
(well for unix you can)
Last edited by beege31337; 11-15-2002 at 12:10 PM.