【操作系统】运行下列程序,给出运行结果并分析运行结果?
#include<stdio.h>#include<unistd.h>intmain{inti;while((i=fork())==-1);printf("i=%d\n"...
#include <stdio.h>
#include <unistd.h>
int main{
int i;
while((i=fork())==-1);
printf("i=%d\n",i);
if(i)
printf("the parent process pid=%d! \n",getpid());
else
printf("the child process pid=%d! \n",getpid());
} 展开
#include <unistd.h>
int main{
int i;
while((i=fork())==-1);
printf("i=%d\n",i);
if(i)
printf("the parent process pid=%d! \n",getpid());
else
printf("the child process pid=%d! \n",getpid());
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询