When we declare:
int* x;
How does the compiler compile this and how does the computer (would it be better to say operating system because it is the one that manages the memory) does this?
I mean, S.O. reserves a space in memory to store a memory address of type int
and names it x
.
But how does he do it? Do you have a flag in your own memory that says you only accept integers? If it were an address for char
what would it change? And how does he know that her name is x
? Would it be another flag?
Thank you.