title: C++ Boost Creating Shared-Memory for two different processes
body: <p>So, I'm trying to create a shared-memory segment in a C++ program, so I can for example write a simple character in it, and read that character from another C++ program.</p>
  
  <p>I've downloaded the <code>Boost</code> libraries, as I read it simplifies this process. 
  Basically I have two questions: First of all, how do I write to it after its created? Then what should I write in the second program in order to identify the segment and read the info in it?</p>
  
  <p>This is what I've got so far. It's not a lot, but I'm still new to this (first program):</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;boost/interprocess/windows_shared_memory.hpp&gt;
  #include &lt;boost/interprocess/mapped_region.hpp&gt;
  
  int main(int argc, char *argv[])
  {
     using namespace boost::interprocess;
  
     windows_shared_memory shared (create_only, "shm", read_write, 65536); 
     //created shared memory using the windows native library
     mapped_region region (shared, read_write, 0 , 0 , (void*)0x3F000000); 
     //mapping it to a region using HEX
  
     //Here I should write to the segment
  
     return 0;
  }
  </code></pre>
  
  <p>Thanks in advance. Any information I will be more than happy to provide, in order to receive the appropriate help.</p>