Question: Experiment with Forks Run the above code and answer the following question: 1) Notice that mynum is a global variable. --> Child is incrementing the

Experiment with Forks

Experiment with Forks Run the above code and answer the following question:

Run the above code and answer the following question:

1) Notice that mynum is a global variable.

--> Child is incrementing the ascii value of mynum

--> Parent is not

--> Child and Parent can take turns running

Why does child print CHILD0, CHILD1, CHILD2, etc whereas parent prints PARENT0, PARENT0, PARENT0, etc? Remember mynum is a global variable.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!