Possible Duplicate:
printf anomaly after “fork()”
Using fork with c
fork() branches more than expected?
I have this example of code, but I don't understand why this code print 00000000 and not 000000.
When i=0 , print 00
When i=1 , there is 4 process and it will print 0000.
This is the program:
main(){
int i;
for(i=0; i<2 ;i++){
fork();
printf("0");
}
}