Skip to content
Advertisement

Parent/Child and pipes in C, child-parent comunication

I have a parent program that sends a integer to a child, and the child program multiplies the number by two and gives back to the parent.

In a main program I create a pipe and fork() and execl() the child, after a switch I pass the value through pip to child in child i can get the value, but How can I get a result back from the child to the parent after a execl()?.

JavaScript

Advertisement

Answer

Use two pipes.

JavaScript
Advertisement