hi all .. iam new here .. i need a help with programming in c.
my code should do the following :
write a C program with the following command line:
./prog N inFile
The program starts by forking N children processes with separate address spaces. N is an integer in
the range 2-5.
The program then opens the binary (not text) file inFile and reads in records until the file is finished.
Each record consists of two 4-byte integer values. The first value num represents the child number (0
4), and the second is a value val (positive or negative). If num<N, the program sends the value val
to the child num.
Each child continuously receives values from its parent and sums them up. Whenever the sum
reaches or exceeds 100, it reports to its parents and the parent prints a message “Child i reached
100.” The child then resets its sum and starts over.
Once the file is completed, the parent must terminate all its children and terminate itself.
could anyone help me and tell me how to start .. also if anyone has any ex.
thx alot