64,644
社区成员
发帖
与我相关
我的任务
分享
#include<string>
using namespace std;
struct temp
{
string s;
};
int main()
{
const string p="aaa";
temp *q;
q=(struct temp*)malloc(sizeof(struct temp));
q->s=p;
}
#include<string>
using namespace std;
struct temp
{
string s;
};
int main()
{
const string p="aaa";
temp *q;
//q=(struct temp*)malloc(sizeof(struct temp));
q = new temp;
q->s=p;
}