📌  相关文章
📜  用于 c 编程的在线 linux 终端 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:36.794000             🧑  作者: Mango

代码示例6
intmain()
{ 
  inti = 48, pid = -1;
  pid = fork();
  if (pid == -1)
  {
    printf ("Fork failed\n"); 
    i++; 
    exit (1);
  }
  if (pid == 0) 
  { 
    printf ("In child process\n"); 
printf ("Printing current working directory using execlp system call\n");
    i++; 
  } 
  else
  { 
    printf ("In parent process\n"); 
printf ("Name: MAMOONA ASIF\n");
printf ("Roll No: MC180402471\n");
printf ("Program: MIT\n");
    i++; 
  } 
}