char*指针赋值问题
#include <iostream>using namespace std;
int main()
{
char* p1 = new char[10];
char a[100] = "rbrbrr";
a = p1;// 错误IntelliSense: expression must be a modifiable lvalue
cout<<p1<<endl;
cout<<a<<endl;
system("pause");
return 0;
}
求解,为什么同是char*类型,a不能被赋指针值?