Home > Back-end >  2 C
2 C

Time:09-19

Why is D, not B?

CodePudding user response:

Because a.n ame and b.n ame point to the same address
For example
Char * p=(char *) malloc (10);
Strcpy (p1, "zhao");
Char * p2=p1;//p1, p2, pointing to the same address
Printf (" % s ", p2);//what is the result?
Strcpy (p2, "qian");//modify p2 to address information
Printf (" % s ", (p1);//in the same way, the result is here?