When two programs are running at the same time, and you print the address to which the pointer points to, can it happen that both programs print the same value?
Yes. The program runs in a virtual memory allocated by the OS. The amount of virtual memory is determined by the processor architecture.
The address you see refers to the virtual memory address and not to the physical RAM address.
I would add that each process running on a system gets a huge address space (2^32 on a 32-bit OS and 2^64 on a 64-bit OS) allocated to it. It's on this virtual address space that a process runs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With