下面叙述错误的是( )
char acX[]="abc"; char acY[]={'a','b','c'}; char *szX="abc"; char *szY="abc";
szX与szY指向相同的地址。
szX的内容修改后,szY的内容也会被修改。
On the other hand, the declaration
char *p = "abc";
defines p with type ‘‘pointer to char’’ and initializes it to point to an object with type ‘‘array of char’’ with length 4 whose elements are initialized with a character string literal. If an attempt is made to use p to modify the contents of the array, the behavior is undefined.
C/C++ code
但是出运行时错误。
----------------------------------------------------------
我用数组下标的方式是可以修改的: