I am doing fork(), I need to send messages between parent & child..
am using this..
char readbuffer[80];
int fd[2], nbytes;
if(child == 0)
{
close(fd[0]);
nbytes = read(fd[0], readbuffer, sizeof(readbuffer);
index = atoi(readbuffer);
}
else{
close(fd[1]);
sprintf(sending, "%i", index);
write(fd[1], sending, strlen(sending)+1);
}
Index is an integer am sending to the child...its not working.anyone know why???