单选题
对于如下C语言程序
int main()
{
pid_t pid;
int a=1;
pid=fork();
if(pid==0)
printf("This is the son process, a=%d\n", ++a);
else
printf("This is the dad process, a=%d\n", --a);
}在UNIX操作系统中正确编译链接后,其运行结果为
A、
This is the son process, a=2This is the dad process, a=0
B、
This is the son process, a=2
C、
This is the dad process, a=0
D、
This is the dad process, a=2This is the son process, a=0
【正确答案】
A
【答案解析】
提交答案
关闭