I am writing a command shell in C++ using the POSIX api, and have hit a snag. I am executing via execvp(3), so I somehow need to turn the std::string that contains the command into a suitable array of char\* consts\*'s that can be passed to:

```
int execvp(const char *file, char *const argv[]);

```

I have been racking my brain for hours but I can't think of any realistic or sane way to do this. Any help or insight on how I can achieve this conversion would be greatly appreciated. Thank you and have a good day!

edit:
As per request of Chnossos, here is an example:

```
const char *args[] = {"echo", "Hello,", "world!"};
execvp(args[0], args);

```