#include<stdio.h>
#include<stdlib.h>
void main()
{
char *p;
p = “uvtgyujyg”;
//一
//直接使用*p+n
printf("%c %d\n",*p); //==》u
printf("%c %d\n",*p+1); //==》v
printf("%c %d\n\n",*p+2); //==》w
//直接使用 (*p)+n
printf("%c %d\n",(*p)); //==》u
printf("%c %d\n",(*p)+1); //==》v
printf("%c %d\n\n",(*p)+2); //==》w
//使用 *(p+n) ==> 正确用法 可逐个将p中的各个字符打印出来
printf("%c %d\n",*p); //==》u
printf("%c %d\n",*(p+1)); //==》v
printf("%c %d\n",*(p+2)); //==》t
printf("%c %d\n\n",*(p+3)); //==>g
//不使用* ==》 可打印出该字符串
printf("%s\n",p); //==》uvtgyujyg
printf("%c\n",p); //==》乱码
printf("\n");
//二
//使用*p++时
*p++;
printf("%c %d\n",*p); //==》v
printf("%c %d\n",*p+1); //==》w
printf("%c %d\n\n",*p+2); //==》x
//不使用*
printf("%s\n",p); //==》vtgyujyg (相较于之前少了第一个字符u)
printf("%c\n",p); //==》乱码
printf("\n");
//四
//直接使用p+n ==》 正确
p = p + 1;
printf("%s\n",p); //==》tgyujyg
printf("%c %d\n",*p); //==》t
printf("%c %d\n",*(p+1)); //==》g
printf("%c %d\n",*(p+2)); //==》y
printf("%c %d\n\n",*(p+3)); //==>u
#if(0)
//
//使用(p)+n时 》 //运行直接错误,无法运行
p = (*p)+2;
//使用 (p+n) > 可逐个将p中的各个字符打印出来
printf("%c %d\n",*p); //》u
printf("%c %d\n",(p+1)); //》v
printf("%c %d\n",(p+2)); //》t
printf("%c %d\n\n",*(p+3)); //>g
(*p)++; //运行直接错误,无法运行
printf("%c\n",*p); //==》
printf("%s\n",p); //==》
printf("%c\n",*p+1); //==》
printf("%c\n",p); //==》
#endif
system("pause");
return ;