Hello. I'm writing a simple shell for a project for OS and am having issues with the way I wrote the code. I've set up my input to get two strings, the first is what the argument is (clear, exit, echo...) and the second is everything that is typed afterwards. Now after completing most of my project I am trying to finish up and I have just now realized that execvp takes two arguments, "const char * file" which I can take care of converting my first string to a c string, but the second part takes "char * const argv[]". My question is then, how can I go about converting a string into something that will be accepted as argv[].
I've looked all over and can't seem to find anything on line that has helped so far. Thanks in advanced for the help.
I've looked all over and can't seem to find anything on line that has helped so far. Thanks in advanced for the help.