04-22-2012, 11:42 PM
#include <sys/types.h>
#include <sys/wait.h>
pid_t wait(int *stat_loc);
#include <stdio.h>
void main(){
int pid, status;
pid = fork();
if(pid == -1) {
printf(“fork failed\n”
;
exit(1);
}
if(pid == 0) { /* Child */
printf(“Child here!\n”
;
exit(0);
}
else { /* Parent */
wait(&status);
40
printf(“Well done kid!\n”
;
exit(0);
}
}
#include <sys/wait.h>
pid_t wait(int *stat_loc);
#include <stdio.h>
void main(){
int pid, status;
pid = fork();
if(pid == -1) {
printf(“fork failed\n”
;exit(1);
}
if(pid == 0) { /* Child */
printf(“Child here!\n”
;exit(0);
}
else { /* Parent */
wait(&status);
40
printf(“Well done kid!\n”
;exit(0);
}
}
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
