Communicating between processes using shared memory

In this recipe, we will learn how communication between two processes is established using shared memory. This recipe is divided into the following parts:

We will start with the first one, that is, Writing a message into shared memory. The functions we learned in the previous recipe will also be applicable here.