Question: Write a C program prog.c with the header file prog.h which asks the user to input four strings for his first and last names, program
Write a C program prog.c with the header file prog.h which asks the user to input four strings for his first and last names, program name and course number. Then, it sets a new environment variable called COURSE with the input value from the user using setenv. Also, it creates a child process that executes the program (already read from the user ) and send the two input name strings as command line argument and the environment variable. Meanwhile, the parent process should reap the child process and print the child exit status if child had been normally terminated. Make sure you handle all the possible errors properly with clear error messages and proper wrappers.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
