Help with understanding C code in my text

This is a discussion on Help with understanding C code in my text within the C Programming forums, part of the General Programming Boards category; I am reading a book on operating systems before I go on to try and learn C. The book often ...

Help with understanding C code in my text

I am reading a book on operating systems before I go on to try and learn C. The book often lists code to illustrate points, and while it is not mandatory I understand it, I would like to so I can better learn from it. Both of the following codes were presented:

This is supposed to represent how a child process that is running a copy of a program from the parent process looks in C coding for unix. I understand some things, like the idea of a fork statement, and the text tells me what the equation tries to accomplish. More direct and specific insight would be great though.

The second equation below is supposed to represent how to create a child process function. How though is yet unclear to me. I have been told that it has something to do with microsoft paint as a shared resource, but they were very vague:

As to how fork works etc, you probably need to give us a better question than "more insight" - I could probably write two pages worth of information on what fork does and how it works, but it would quite possibly NOT answer your question.

I have no idea what your question as to the second piece of code is? What do you mean by "shared resource"? mspaint is a very simple application supplied as part of Windows installations.