The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 07-05-2004
Registered User
 

Join Date: Jun 2004
Location: Italia - Napoli
Posts: 6
alternately writings

Hi,

can anyone show me how to solve the following exercise in ANSI C?

Create 2 process (parent & child).

The parent have to create a file called file<pid>, where <pid> is the process ID of the child process.

For n times (where n is a constant previously defined) the child process and the parent process alternately write in file<pid> a sentence (like "I'm the child" or "I'm the parent") and their process ID.

After n writings the parent process write in file<pid> the termination status of child process.

I hope you understand.. It's so important, please help me!

Thank's!
Forum Sponsor
  #2  
Old 07-05-2004
Driver's Avatar
Registered User
 

Join Date: Jul 2001
Location: Bremen, Germany
Posts: 34
I'm sorry, we won't do your homework. See point 6 of the rules:

Simple rules of the UNIX.COM forums:

Ask your teacher if you're stuck. (and buy ``Advanced Programming in the UNIX Environment'' by Richard Stevens.)

On a side note, ANSI C does not have the concept of processes. Therefore, what you want is presumably a POSIX or UNIX solution.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0