Thank you so much guys for you assist
i understood very well how this works.
let's say i want to start another process and make it execute another program.
im tryin things now. what i did is i wrote a program called trivial.c all it does is loop 5 times and each time its sleeps for 4 seconds i.e;
for(int i=0; i<5; i++)
{
sleep(time);
}
if i want the program i posted above to execute my trivial.c
the only changes i have to make are these :
char *new_cmd = "/Desktop/trivial" /*suppose i have it on my desktop*/
char *cmd_args[]= {"trivial"}; /*i only pass the name of the program nothing else because it doesnt take any parameters*/
char *cmd_env[] = {NULL};
status = execve(new_cmd, cmd_args, cmd_env);
right?
thanks