标题:求教这个该怎么改,谢谢
取消只看楼主
xl327134332
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-4-20
 问题点数:0 回复次数:2 
求教这个该怎么改,谢谢
#include <iostream>
#include <string>
using std::string;
int main()
{
 int *pci_bad=new  int[100];
 const string *pci_ok=new const string[100]();
    return 0;
}
//error C2468: 'new' : cannot allocate 'const'/'volatile' objects (type is 'const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > [100]')


[ 本帖最后由 xl327134332 于 2013-5-25 21:10 编辑 ]
搜索更多相关主题的帖子: include cannot return objects 
2013-05-25 20:40
xl327134332
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-4-20
得分:0 
目的是创建动态数组
2013-05-25 21:11
xl327134332
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-4-20
得分:0 
没有哪位高手帮我解答一下嘛,我纯新手不知道怎么创建动态数组
2013-05-26 22:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-408006-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.635183 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved