请教各位老师:我在学CCS C编译器时发现:当在程序空间设置一个常量数组如:const char s[15] = {"this is a test"}时,如设一个指针变量:char *ptr,当想试用该指针查找上面数组元素时,如写上:ptr = s;的初始化语句时,在编译时该语句会出错,而把const char s[15] = {"this is a test"};语句改为不在程序空间设置(即:char s[15] = {"this is a test"};)时,ptr = s;语句就编译通过了,这是为什么? |