These are all versions of exec that can be used in C (and C ++)
execl execle execlp execv execve execvp
What is the difference between the two? How do you know which one to use?
Differences are combinations:
L vs V : do you want to pass parameters to exec'ed as
execl()
execle()
execlp()
execlpe()
execv()
execve()
execvp()
execvpe()
The array format is useful when the number of parameters that should be sent to the exec process are variables - as in a previously unknown one, so you cannot set a fixed number of parameters in a call function.
E. Versions with "e" at the end allow you to optionally pass an array of char *, which is a set of lines added to the environment of processed processes, before the program starts. Another way to pass parameters.
P : in versions with 'p', an environment path variable is used to search for an executable file called execute. For versions without "p", an absolute or relative path to the file is required, which must be added to the file name of the executable file if it is not in the current working directory.
Opengroup is one of the best generic links for core c / C ++ functions.
The documents for exec * are here: http://pubs.opengroup.org/onlinepubs/009695399/functions/environ.html
This is an extension of the Posix C runtime library. If the official Posix documentation is not enough, I can recommend the book - Samuel P. Harbison, Guy L. Steele, 2002 "CA Reference" Page No. 416 - consider this.