when i compile in in C with gcc no problem..
when i compile it as c++ i get this error..
1 2
Test.cpp: In function int spawn(char*, char**):
Test.cpp:25: error: cannot convert char** to constchar* for argument 2 to int execlp(constchar*, constchar*, ...)
Use execv() if you know the full path of the file to execute.
Use execvp() if you want to search for the file to execute the same way as the shell does.
The arguments to your function should be const:
1 2 3 4
int spawn(constchar *cwd, constchar **arg_list)
{
...
}