Need to know how fork works?

前端 未结 7 1782
[愿得一人]
[愿得一人] 2020-12-15 13:32

I am trying the following C code:

int main()
{
    printf(\"text1\\n\");
    fork();
    printf(\"text2\\n\");
    return 0;
}

I was expect

相关标签:
7条回答
  • 2020-12-15 14:18

    The child process will start from the position of the fork(), so you are getting the correct output.

    0 讨论(0)
提交回复
热议问题