<p>Maybe this cannot be done, but please help or suggest how this can be achieved without writing something to disk.</p>

<p>Lets suppose there are two string values that I want to share between two independent applications.</p>

<p>You are welcome to provide code sample in any programming language.</p>

What you probably want to do is create a memory-mapped file. You can create a memory-mapped file that doesn't have any backing store on disk, but is instead backed by the system page file. Have a look at the documentation for
```
CreateFileMapping
```
, in particular when the first parameter is
```
INVALID_HANDLE_VALUE
```
.
You can give such a file mapping a unique system-wide name, and then other applications can open it using
```
OpenFileMapping
```
and providing the same name.
Once you have such a block of shared memory, you can put any information you like into it. Note that since the memory is shared across processes, you don't want to store any pointers into the block of memory (which precludes doing things like storing a
```
std::string
```
there).