1. What is a Pointer?

int x = 10;
int *p = &x;  // p stores the address of x

2. What is a Double Pointer?

int x = 10;
int *p = &x;   // p points to x
int **pp = &p; // pp points to p

3. Visualizing Pointers and Double Pointers:

x: 10  (stored at some memory location, say 0x100)
p: 0x100  (p points to x, storing the address of x)
pp: 0x200  (pp points to p, storing the address of p)

4. Why Use Double Pointers?

5. Simple Code Example:

Here's a very simple example to illustrate:

#include <stdio.h>

void changeValue(int **pp) {
    **pp = 20; // Dereferencing twice to change the value of x
}

int main() {
    int x = 10;
    int *p = &x;
    int **pp = &p;

    printf("Before: %d\\\\n", x); // Prints 10

    changeValue(pp);

    printf("After: %d\\\\n", x); // Prints 20

    return 0;
}