父進程等待子進程退出

#include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> int main() { pid_t pid; int cnt = 0; pid = fork(); if(pid>0) { wait(NULL); while(1) { printf(「th
相關文章
相關標籤/搜索