hi .. i need a help


 
Thread Tools Search this Thread
Top Forums Programming hi .. i need a help
# 1  
Old 12-25-2010
hi .. i need a help

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
# 2  
Old 12-25-2010
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
This User Gave Thanks to Scott For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question