题目内容
以下程序的输出结果是()#include #include #include #include #include int main(int argc, char *argv[]){printf("===================start of file\n");pid_t pid = fork();if (pid == -1) {perror("fork error");exit(1);} else if (pid == 0) {printf("---child,my pid is %d,my parent pid is %d\n",getpid(),getppid());} else if (pid > 0) {printf("---parent my child is %d,my pid is %d,myparent pid is %d\n", pid,getpid(),getppid());sleep(1);}printf("===================end of file\n");return 0;}
查看答案
搜索结果不匹配?点我反馈
更多问题