16,472
社区成员
发帖
与我相关
我的任务
分享
typedef struct
{
int nTime;
char pStr[10];
}node;
queue<node> q1;
char chArray1[] = {'0','1','2','3','4','5','6','7','8','9'};
node struNode;
for(int i = 0; i< 10000000;i++)
{
memcpy(struNode.pStr, chArray1,10);
struNode.nTime = i;
q1.push(struNode);
}
//出队
while(!q1.empty())
{
//delete []q1.front().pStr; //这样写法释放字符数组报错,为什么????
q1.pop();
}