Pointers
Addresses
A pointer stores the address of another object.
Addresses
addresses.c
#include <stdio.h>
int main(void) {
int value = ;
int *ptr = &value;
int same = (*ptr == value);
printf("same=%d\n", same);
return 0;
}
#include <stdio.h>
int main(void) {
int value = ;
int *ptr = &value;
int same = (*ptr == value);
printf("same=%d\n", same);
return 0;
}
#include <stdio.h>
int main(void) {
int value = ;
int *ptr = &value;
int same = (*ptr == value);
printf("same=%d\n", same);
return 0;
}
address-of
The `&` operator produces the address where a variable is stored.
pointer value
An `int *` variable can hold the address of an `int`.