hi, i have a string :
char* string = "ls -a";
do i have to extract ls out from the entire string to use execlp/execvp/execl/... command? is there a way to run the command without extracting it?
hi, i have a string :
char* string = "ls -a";
do i have to extract ls out from the entire string to use execlp/execvp/execl/... command? is there a way to run the command without extracting it?
I think so, and you would also need to construct an array (of the form: "ls", "-a", NULL) to pass the arguments.do i have to extract ls out from the entire string to use execlp/execvp/execl/... command?
You could use system() instead.is there a way to run the command without extracting it?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
String literals should be const char: http://cpwiki.sourceforge.net/Common...kes_and_errors