#include <stdio.h>

int main() {
    // two int variables and pointers pointing to them
    int x = 10, *p = &x;
    int y = 20, *q = &y;

    // create a pointer-to-pointer, pointing to p
    int **r = &p;

    // print the value of x through r.
    printf("x = %d\n", **r);

    // make r point to q
    r = &q;

    // print the value of x through r.
    printf("y = %d\n", **r);

    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: