This problem is mainly different about the value of the global variable in two ways.
The following applet: / ****************************************************************************** / # include
Static char * head;
Void change (char *); / ******************************************* / INTMAIN (VOID) {char name [ ] = "Xiongbin Xiong./N"; char * p;
P = Name; Head = P;
Printf ("main () _ 1:% s", head);
Change (P);
Printf ("Main ()_ 2:% S", Head);
Exit (0);} / ***************************************************************************************************** / Voidchange (char * PTR) {char * q;
Q = PTR; Q = Q 5; Head = q;
PRINTF ("Change ():% s", head);} / **************************************** ***** / Direct GCC compile, run, output results: main () _ 1: xiongbin xiong.change (): bin xiong.main () _ 2: bin xiong. Divided into 3 files into 3 files. h, main.c, change.c Using Make to compile, run, output results: main () _ 1: xiongbin xiong.change (): bin xiong.main () _ 2: xiongbin xiong. Both output results are different. of. I now think that when you are compile, the change in global variables in a function cannot cause changes in the value of this variable in other functions. But in the end, what is going on, what is the rule? I do not know yet/. Have to learn.