+ 1
C - Why can't you get address of a register variable?
Why does this code fail at p = &x ? #include <stdio.h> int main() { register int x = 4; int* p; p = &x; x++; printf("%d",*p); return 0; }
1 Odpowiedź
+ 6
Because registers are build into the cpu, they don't have an address.
https://en.wikipedia.org/wiki/Processor_register