69,371
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
int main(void)
{
char note[] = "See you at the snack bar.";
char * ptr;
ptr = note;
puts(ptr);
puts(ptr+1);
note[7] = '\0';
puts(note);
puts(ptr);
puts(++ptr);
return 0;
}
你在开始的时候已经对指针进行更改了。。。#include<stdio.h>
int main(void)
{
char note[] = "See you at the snack bar.";
char * ptr;
printf("0. note: %p\n", note);
ptr = note;
printf("1. pstr: %p\n", ptr);
puts(ptr);
puts(++ptr);
printf("2. pstr: %p\n", ptr);
note[7] = '\0';
puts(note);
puts(ptr);
puts(++ptr);
printf("3. pstr: %p\n", ptr);
return 0;
}