c fork wait for child
int main(){
pid_t pid = fork();
if (pid == 0) {
printf("HC: hello from child\n");
exit(17);
} else {
int child_status;
printf("HP: hello from parent\n");
waitpid(pid, &child_status, 0); // Waits for child to end
printf("CT: child result %d\n", WEXITSTATUS(child_status));
}
printf("Bye\n");
return 0;
}sleep(/*How many seconds do you want to wait*/);
Also in C:
- Declare macro
- inurl:fiu.edu math faculty
- sum of arrays
- ruby find object in array by attribute
- C %d
- pointer offset notation
- c print long
- vbl share price
- sdl audio
- how to run a update comand in linux
- check if string starts with c
- switch case c
- boolean c
- powershell some fonts like #include are dissapearing
- c concatenate strings
- main function in c
- write a program to ask the user 8 integer numbers. your program will then move all negative elements of your array to the end of the array without changing the order of positive elements and negative elements
- c program to find number of days in a month using switch case
- vbnet create and write on file
- how to read space separated words in c
- if statement shorthand c
- counter program in c language
- rakshabandhan 2020
- stack