与全球矢量的不良同种
Bad Alloc with Global Vector
本文关键字:不良 更新时间:2023-10-16
我想通过指令" iinc(10,20(",我想在指令中添加每个数字。因此,我的全球向量应为< 10>< 20>之后。我的运行时间错误说
terminate called after throwing an instance of 'std::bad_aloc'
what(): std:: bad_aloc
aborted
代码:
vector<int> number_list;
void add_number(string input)
{
int count = 5;
vector<char> trythis;
while(input[count] != ')')
{
do{
trythis.push_back(input[count];
count++;
}while(input[count] != ',');
string temp(trythis.begin(), trythis.end());
int real = atoi(temp.cstr());
number_list.push_back(real);
count++;
}
}
string temp(temp.begin(), temp.end());
变量'temp'在其自己的初始化中使用
相关文章:
- 为什么"using System;"不被视为不良做法?
- 提升不良词法强制转换:将字符串转换为无符号长整型时,无法将源类型值解释为目标
- 删除复制构造函数的 Intel 13.1.2 中不良C++行为的解决方法
- 如果 constexpr 和依赖假static_assert形成不良?
- 不从成员函数C 存储返回值认为不良习惯
- shared_from__this,asio的不良弱ptr例外
- 试图初始化矩阵C 时的不良同种
- 创建以不良输出结束
- 检测`boost :: Math ::工具:: brent_find_minima()的不良输入
- C HTTP POST 400不良请求
- OPENCV错误:不良的参数(字节必须为16、32或64)在简介Descriptorextractorimpl中
- 与全球矢量的不良同种
- 限制C++中允许的模板参数是否被认为是不良样式?
- 从触摸回调访问向量元素的方法时,不良访问错误
- 不良指针和乱码的数据
- CGAL:Hausdorff距离不良Alloc
- 如果您的团队同意一组别名,则使用类型别名进行STL容器不良练习
- 异常的不良TypeInfo名称
- 400 Casablanca cpprestsdk的不良要求
- 是一个未删除的无限,而循环不良练习