#include <stdio.h>
int main(int argc, char *argv[])
{
char *p1="123";
char *p2="123";
char *p3="456";
const char *p4="abc";
const char *p5="abc";
const char *p6="def";
printf("p1地址:%x\n",p1);
printf("p2地址:%x\n",p2);
printf("p3地址:%x\n",p3);
printf("p4地址:%x\n",p4);
printf("p5地址:%x\n",p5);
printf("p6地址:%x\n",p6);
char *a="windows";
char *b="123";
printf("a地址:%x\n",a);
printf("b地址:%x\n",b);
b=a;
printf("b=a后:\n");
printf("a地址:%x\n",a);
printf("b地址:%x\n",b);
printf("a的内容:");
puts(a);
printf("b的内容:");
puts(b);
char str[80]="win10";
char *p=str;
printf("str地址:%x\n",str);
printf("p地址:%x\n",p);
printf("str的内容:");
puts(str);
printf("p的内容:");
puts(p);
str[3]=‘x‘;
printf("str[3]=‘x‘后:\n");
printf("str地址:%x\n",str);
printf("p地址:%x\n",p);
printf("str的内容:");
puts(str);
printf("p的内容:");
puts(p);
return 0;
}本文出自 “10628473” 博客,请务必保留此出处http://10638473.blog.51cto.com/10628473/1965425
原文:http://10638473.blog.51cto.com/10628473/1965425