#include <stdio.h>
#include <stdlib.h>
unsigned int x = 10;
unsigned int *ptr = &x;
unsigned int **pptr = &ptr;
const char *p[4] = {"PIC16", "PIC18", "PIC24", "DSPIC"};
const char **pp = &p[0]; // const char **pp = p;
void string_access(const char **str_ptr)
{
unsigned char i = 0;
unsigned char ch;
do
{
ch = *(*str_ptr+i);
printf("%c",ch);
i++;
}
while(ch != '\0');
printf("\n");
}
int main(void)
{
printf("x value = %d\n", x);
printf("x address = %p\n", &x);
printf("ptr address = %p\n", &ptr);
printf("ptr point to = %p\n", ptr);
printf("ptr point value = %d\n", *ptr);
printf("pptr address = %p\n", &pptr);
printf("pptr point to %p\n", pptr);
printf("*pptr point to %p\n", *pptr);
printf("pptr point value = %d\n", **pptr);
printf("---------------------------\n");
string_access(&*pp);
pp++;
string_access(&*pp);
pp++;
string_access(&*pp);
pp++;
string_access(&*pp);
system("pause");
return 0;
}