'Can C++ return different memory address for same variable with & operator?

If two or more processor cores copy a variable into their local cache, how C++ handles that? Does &var return a different memory address depending on which core executed that instruction?



Solution 1:[1]

The address you get is the logical address in RAM not the address in cache. Its the cache controllers job to 'know' what RAM address are in what parts of its caches

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1