Pointers
Basic Pointer
Print a variable’s value and address using a pointer.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Print a variable’s value and address using a pointer.
#include <stdio.h>
int main() {
int x = 42;
int *p = &x;
printf("Value : %d\n", *p);
printf("Address : %p\n", (void *)p);
return 0;
}
Value : 42
Address : 0x7ffd... (varies by system)