0
pid = fork();
if(pid == 0)
{
getchar();
printf("Hello From Child\n");
}
else
{
printf("Hello From Parent\n");
}
printf("Hello From %d\n",getpid());
這是我得到的輸出:爲什麼孩子中的getchar()沒有執行?
[email protected]:/home/test#./a.out
Hello From Parent
Hello From 2370
[email protected]:/home/test# Hello From Child
Hello From 2371
在孩子printf語句中的getchar之前執行()?
希望能有一個答案的問題PLZ。 – user3480226