15 lines
335 B
C
15 lines
335 B
C
|
#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;
|
||
|
}
|