Take a look at the "exec" functions. They will do what you want. Do a "man execlp" for help.