Assuming the fork () call did not fail, how many times will the message “Hello! \ N” be displayed?

后端 未结 0 1652
悲&欢浪女
悲&欢浪女 2021-02-01 03:30

The answer I think it\'s 3, but I am not sure about that.

main() {
int a = 0;
int rc = fork();
a++;
if (rc == 0) {
        rc = fork();
        a++;
    } else {
         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题