Hi, I am new to Unix & C++ programming, and I am having trouble correctly creating child processes. I want to create a specific number of processes (let's say 5) that all have the main process as their parent. Is this possible?
What I'm trying to do is have the parent send the child's process id to that specific process and the child will print it. But when I execute this, I get way too many outputs which say 'process ## ID: 0'. Can somebody help me?
I solved it! I removed the statements which close the pipe. I guess whenever a pipe is completely closed, it becomes useless and you will have to use a different pipe.