#include <stdio.h>
#include <stdlib.h>
int main(void) {
char *ptr1 = "Hello World\n";
char *ptr2;
ptr2 = ptr1 + 6;
ptr2 = "Test!\n";
printf("%s",ptr2);
printf("%s",ptr1);
return EXIT_SUCCESS;
}
输出:指针 - 查询
Test!
Hello World
为什么我没有得到Hello Test!
? 我以为id会覆盖World
-part从ptr1
。
我相信你可以写出比这更好的标题。 – 2011-07-17 00:14:24