4
When we declare :
int* x;
How the compiler compiles this and how the computer (it would be better to say operating system because it manages memory) performs this ?
I mean, the O.R. reserves a space in its memory to store a memory address like int
and names her after x
.
But how does it do that? Does it have a flag in its own memory that says it only accepts integers ? If it’s an address for char
what would change? And how does he know that her name is x
? It would be another flag ?
Grateful.
Related question: What are and where are the "stack" and "heap"?
– bfavaretto