qfedu-c-level/day9/d5.c

15 lines
335 B
C
Raw Permalink Normal View History

2023-07-13 19:18:49 +08:00
#include <stdio.h>
int main()
{
char arr[] = "abcedf";
char *p = &arr[0]; // 指向数组的第一个元素的内存地址
printf("arr[0]=%c\n", *p);
p++; // 指向数组的第二个元素的内存地址
printf("*p=%c\n", *p);
do
{
printf("*p=%c\n", *++p);
} while (*p != '\0');
return 0;
}