69,368
社区成员
发帖
与我相关
我的任务
分享
#include <stdlib.h>
#include <stdio.h>
int main()
{
char *p1 = "hello";
char *p2 = "hello";
printf("%p %p\n",p1,p2); //你会发现,p1和p2的地址相同,同指向静态区的同一个"hello"
return 0;
}
char word[] = "frame";
char * p = (char*) malloc(6);
strcpy(p,"hello");