#include
#include
void main() { printf("main/n"); test1(); test1(); printf("inp in main is :%s","0123456789"); getch(); } test1(){ char *ptr = "0123456789"; printf("test1/n/n"); ptr[1]='a'; printf("ptr is :%s/n/n",ptr); printf("inp is :%s/n/n","0123456789"); } test2(){ char *ptr = "0123456789"; printf("test2/n/n"); ptr[1]='c'; printf("ptr is :%s/n/n",ptr); printf("inp is :%s/n/n","0123456789"); }
字符串常量是全局静态的
最新推荐文章于 2022-01-18 00:10:20 发布