Home › C Tutorial › C memory address
C memory address
Where a variable lives.
&x gives the address of x. Print it with %p. The value differs every run.
Example code
#include <stdio.h>
int main() {
int x = 5;
printf("%d at %p\n", x, (void*) &x);
return 0;
}