不会。
如果p指向一个结构体变量stu,以下三种用法等价:
1. stu.成员名
如stu.num
2. (*p).成员名
如(*p).num
3. p->成员名
如p->num
(*p).name
等价于 p->name "->"
称为指向运算符
所以指向运算符不会移动指针。
可进行如下试验
include <stdio.h>
int main() {
struct Student{
char name[20];
int num;
}student;
student.num=100;
Student *p;
p=&student;
printf("%d\n",student.num);
printf("%d\n",(*p).num);
printf("p:%d\n",p);//初始位置
printf("%d\n",p->num);
printf("p:%d\n",p);//使用指向运算符后的位置
return 0;
}
结果如下:
100
100
p:2686724
100
p:2686724