如以下代码:

#include <stdio.h>
int main()
{
  char *s[] = { "aaa","bbb","ccc" };    
  char **p = s;
  for (int i = 0; i < 3; ++i)
  {
    printf("%s\n", *(p+i));
  }
  system("pause");
  return 0;
}

p是一个二级指针,s是一个指针数组,把s的首元素的地址传递给p,然后在*p解引用即得到了字符串”aaaaaa”的地址,然后输出。

如下图:
1

Last modification:February 27, 2019
If you think my article is useful to you, please feel free to appreciate