I can only hope that you/your instructor misinterpreted each other; the first argument to execve() is the path to the program you want to run, not a directory to search. If she claims it is the latter, you're going to have to forget what you learned during this class.
The exec functions with a "p" in the name search $PATH as you would expect. If you need to change the path, it's probably easiest just to use setenv() to change $PATH, remembering to set it back to the original value if necessary. But if you know the directory beforehand, you can just directly call the binary (as in "/bin/ls" or whatever).
Also, when you use the exec functions, your list must be terminated with a null pointer. That is, the following is bad:
Code:
execl("/bin/ls", "ls", "-l");
Instead, you want:
Code:
execl("/bin/ls", "ls", "-l", (char *)NULL);
Unfortunately, that cast is necessary.