Answer to Question #49874 in C++ for ama nae
#include <stdio.h>
#include <sys/types.h>
#include <wait.h>
pid_t wait(int *status);
void fork9();
void main() {
fork9(); }
void fork9() {
int child_status;
if (fork() == 0) {
printf("HC: hello from child\n"); }
else {
printf("HP: hello from parent\n");
wait(&child_status);
printf("CT: child has terminated\n"); }
printf("Bye\n");
exit(0);
}
Remove statement wait(&child_status); and compile and execute the program. Explain
the answer.
0
Answer in progress...
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment