#include<stdio.h>
#include<unistd.h>
int main()
{
int i;
for(i=0;i<4;i++)
fork();
return 0;
}
my question:Include the initial parent process, how many processes created by the program?
I think this answer is 1+4=5 , 1 parent process and 4 child process ,am i right?
thanks
The answer using fork() four times is: 2 * 2 * 2 * 2 - 1 = 16 - 1 = 15 processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With