No, it's not that simple. :)
Modern operating systems use virtual memory.
Each process is provided with a full virtual address space.
Each process is provided with its own "view" of all addresses (from 0x00000000 to 0xffffffff on a 32-bit system). Processes A and B can write to the same address without affecting each other, since they do not have access to physical memory addresses, but to virtual addresses. When a process tries to access a virtual address, the OS translates this to another physical address in order to avoid collisions.
Essentially, the OS keeps track of the memory page allocation table for each process. It keeps track of which address ranges have been allocated to the process, and to which physical addresses they are mapped. If a process tries to access an address that is not assigned to it, you will receive an access / segmentation violation. And if you try to access the address that is assigned to your process, you will get your own data. Thus, there is no way to read data from other processes by simply typing the “wrong” address.
jalf
source share