求const相关问题的答案
#include<stdio.h>#include<windows.h>
int main()
{
char *str;
str="12345";
*str='a';
puts(str);
system("pause");
}
请问为什么字符指针str不是const型指针却能接受“12345”的赋值,但当运行到*str='a'时却访问为例;
明显是把str当成const指针处理嘛
2010-06-13 22:03
2010-06-13 22:12
2010-06-13 22:26
2010-06-13 22:30
2010-06-13 22:33
2010-06-13 22:53