If somewhere in my code, I use the address of a variable (pass it to some other function, for example), the compiler will automatically choose to store it in memory? (as opposed to the possibility of storing it in a register).
Otherwise, what happens if I ask for the address of a variable like that (stored as register)? I know we can't take the address of variables explicitly set to register (register int c
).
EDIT:
For example, if i do something like
int c = 1;
print("Address of c: %p", &c);
Then this variable couldn't be stored in a register, could it? The compiler would automatically set it as stored in memory? Otherwise (if it is just stored in a register), what would be the address shown in the screen?