基于如何调用循环方法来表示孩子和父母,我不确定一项任务

在uni的实验室工作中,我必须用一种方法来替换带有下划线的伪代码,以解决涉及“调用循环方法,传入2代表孩子”的任务的方法,我真的不确定如何启动此任务。

if( childProcess >= 0 ) {
if( childProcess == 0 ) {
// this is the child process
printf("New process has id %d,parent id %d\n",getpid(),getppid() );
// call the loop method,passing in 2 to represent child
exit(0);
} else {
// this is the parent process
// call the loop method,passing in 1 to represent parent
}
} else printf("Error when trying to create a new process!\n");
return 0;
}
Evly_Js 回答:基于如何调用循环方法来表示孩子和父母,我不确定一项任务

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3127798.html

大家都在问