对于如下C语言程序 int main() { pid_t pid; int x=1; pid = f

计算机考试 已帮助: 时间:2024-08-20 15:43:21

对于如下C语言程序 int main() { pid_t pid; int x=1; pid = fork(); if(pid==0) printf("I am the child process, x=%d/n", ++x); else printf("I am the parent process, x=%d/n", --x); } 在UNIX操作系统中正确编译链接后,其正确的运行结果是
A.I am the child process, x=2
B.I am the parent process, x=0
C.I am the parent process, x=2
D.I am the child process, x=0
请帮忙给出正确答案和分析,谢谢!

难度:⭐⭐⭐

题库:计算机类考试,计算机四级,嵌入式系统开发工

标签:正确答案,请帮忙,正确

相似问题