新手菜鸟遇到问题, 希望高手解决下
#include <iostream>#include <cstring>
struct node
{
char f_name[20];
};
int main()
{
using namespace std;
node* p = new node;
p->f_name = "mary";
char* name = new char[20];
cin >> name;
cout << name << endl;
strcpy_s(name, 4, p->f_name);
cout << name << endl;
delete name;
return 0;
}
问题是: p->f_name = "mary"; error C2440: “=”: 无法从“const char [5]”转换为“char [20]”