I have been working on semaphores and shared memory for a week now, and have some difficulties yet,so i tried to make this program which the children are supposed to write t
The code calls fork() in two places. Remove the second call.
fork()
Change:
if((child[i] =fork())==0){
to:
if(child[i] == 0){