I am trying to execute the cp
command with two options --preserve
and --interactive
And in my code I have:
char const *copy[] = {"/bin/cp","cp","-p","-i",0};
execv(copy[0],copy);
But it is giving me this error
error: invalid conversion from 'const char**' to 'char* const*'
error: initializing argument 2 of 'int execv(const char*, char* const*)'
What should I change for this to work?