// Basic pointer demo
// 2019-10-10
#include <stdio.h>

// argv is a vector (array) of pointers to pointers-to-characters
// argc is the length of the vector
int main(int argc, char **argv)
{
    printf("program: %s\n", *argv);

    // Show WHERE the elements are:
    for (char **pa = argv+1; pa < argv + argc; pa++)
        printf("%p\n", pa);
    printf("#----------------\n\n");

    // Show each of the char-pointers, and the string it points to:
    for (char **pa = argv+1; pa < argv + argc; pa++)
        printf("%p %s\n", *pa, *pa);
    
    return 0;
}