I have two C programs, Project1A.c and Project1B.c. I'm trying to use execl() to execute Project1A from inside Project1B but so far it's not working.
Project1B.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main ()
{
pid_t pid;
switch((pid = fork()))
{
case -1:
printf("I'm sorry, fork failed\n");
break;
case 0:
execl("Project1A.c", "./prog", NULL);
printf("EXECL Unsucessfull");
break;
default:
printf("This is some parent code\n");
break;
}
printf("End of Program\n");
return 0;
}