当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

请分析以下程序。 int main() { pid_t pid; pid = fork(); if(pid==0) printf(I am the child pr


请分析以下程序。 int main() { pid_t pid; pid = fork(); if(pid==0) printf("I am the child process, my process ID is%d ",getpid()); else printf("I am the parent process, my process ID is%d ",getpid());} 那么,该程序正确运行后的结果是

A.I am the child process, my process ID is 3744 I am the parent process, my process ID is 3987

B.I am the child process, my process ID is 3744

C.I am the parent process, my process ID is 3987

D.不输出任何信息

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • 请选出以下程序的输出结果 #include<stdio.h> main() {int a[]={1,2,3,4},i; int x=0; for

  • 对于如下C语言程序 int main() { pid_t pid; int x=1; pid = fork(); if(pid==0) printf(I am t

  • 请选出以下程序的输出结果 #include<stdio.h> main() {int a[]={1 2 3 4} i; int x=0; for

  • 以下程序的功能是计算:s=1+12+123+1234+12345。请填空。 #include int main()

  • 请选出以下程序的输出结果______。#includesub(x y z)int x y *z;{ *z=y-x;}main(){int

  • 以下程序段给数组所有的元素输入数据 请选择正确答案填入。 #include main() { int a[10