qfedu-c-level/day9/d7.c

13 lines
245 B
C
Raw Permalink Normal View History

2023-07-13 19:18:49 +08:00
#include <stdio.h>
int main()
{
int arr[10] = {1, 2, 3, 4, 5, 6};
int *p = arr;
int *q = p + 2; // 指向 arr 数组的第三个元素地址
int x = *q + 100; // *(p + 2) + 100
printf("x=%d\n", x); // 103
return 0;
}