?? fork.c
字號:
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
pid_t result;
result = fork();
if(result == -1){
perror("fork");
exit;
}
else if(result == 0){
printf("The return value is %d\nIn child process!!\nMy PID is %d\n",result,getpid());
}
else{
printf("The return value is %d\nIn father process!!\nMy PID is %d\n",result,getpid());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -