![]() |
Hi,
I need some help with using the fork() command. What I need to do is have the program create 3 child processes using fork() then each of the 3 child processes create 1 process each using fork(). Then I need the proces ID's of each process to be printed. I have gotten the first part where I create 3 child processes, now I don't know where to insert another fork() such that each of the 3 child processes creates 1 child process of its own. I am using the bash shell and using the "Pico" text editor to write this C Program. I am using the 'gcc' compile command to compile the program. Here is the code I have so far: :
#include <stdio.h> |
Quote:
Try it like this :
#include <stdio.h>Just remember if you have more than on "(" in a statement then you need to add 2 )) at the end of it. |
Thankz but that'z not the problem...the code works correctly...I jsut want each of hte 3 child processes to spawn 1 child of their own.
Thankz |
Sebeq, take a look at that if statement - in your version, there are 3 opening tags and 4 closing tags. He was right.
|
Ahhh yes now i feel like a dummy. I can't see why i didn't see that :P
|
| All times are GMT -5. The time now is 11:14 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC