How to input data into char array?
I'm trying to create a simple unix shell. Right now I'm having problems inputting the command and arguments that a user types in. I need to pass them off to execvp to execute the command. This is what the call to execvp looks like:
int execvp(const char *file, char *const argv);
So, I need to get the command as char* and the arguments as char*. This is what I tried to do, but got a segmentation fault:
cout << "command: ";
cin >> c;
cout << "args: ";
cin >> args >> args;
Any idea how to do this properly? Thanks!