您好我是c ++的初学者,有人可以向我解释一下
char a[]="Hello";
char b[]=a; // is not legal
Run Code Online (Sandbox Code Playgroud)
然而,
char a[]="Hello";
char* b=a; // is legal
Run Code Online (Sandbox Code Playgroud)
如果无法将数组复制或分配给另一个数组,为什么它可以作为参数传递,其中传递的值的副本始终在方法中进行
void copy(char[] a){....}
char[] a="Hello";
copy(a);
Run Code Online (Sandbox Code Playgroud)