Please I am trying to create a program that would execute a foreground process.
I have this code for the foreground process
Code:
#include <stdio.h>
#include <signal.h>
int main()
{
int temp;
printf("We are in the current program\n");
scanf("%d", &temp);
printf("Leaving new program");
return 0;
}
And this is my main program
Code:
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
int main()
{
signal(SIGINT, SIG_IGN);
execvp("./scanf", NULL);
printf("How are you");
return 0;
}
My main program stops executing after the process "./scanf" executes and there fore does not print the line "How are You"
I want to main program to continue executing after "./scanf" finishes. Any idea on how to achieve that?