In C programming, two important operators are used with pointers: the address operator (&) and the indirection operator (*).
Address Operator (&):
& before a variable, it gives you the location in memory where that variable is kept.x, using &x will give you the address of x.Indirection Operator (*):
* with a pointer (a variable that holds a memory address), it retrieves the value stored at that address.p that holds the address of x, then *p will give you the value of x.#include <stdio.h>
int main() {
int x = 10; // Declare an integer variable x
int *ptr = &x; // Declare a pointer variable ptr and assign it the address of x
// Print the address of x using the address operator &
printf("Address of x: %p\n", (void*)&x);
// Print the value stored at the address held by ptr using the indirection operator *
printf("Value at address held by ptr: %d\n", *ptr);
return 0;
}