在抛出'std :: bad_alloc'的实例后终止调用 [英] terminate called after throwing an instance of 'std::bad_alloc'

查看:116
本文介绍了在抛出'std :: bad_alloc'的实例后终止调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我的程序中,我必须定义很多指针,当我想要
编译我的程序时(在UNIX中),它给我以下错误:


在抛出''std :: bad_alloc'的实例后终止调用

what():St9bad_alloc

Abort


我重新检查了那些指针;我发现我不能减小它们的大小。

我知道如何解决这个问题吗?


谢谢,

Mohsen

Hello everyone,

In my program, I have to define many pointers and when I want to
compile my program (in UNIX), it gives me the following error:

terminate called after throwing an instance of ''std::bad_alloc''
what(): St9bad_alloc
Abort

I rechecked those pointers; I found I cannot decrease the size of them.
Any idea how I can to solve this problem?

Thanks,
Mohsen

推荐答案

Mohsen写道:
Mohsen wrote:

大家好,


在我的程序中,我必须定义许多指针,当我想要编译我的程序(在UNIX中)时,它会给我以下错误:终止调用

what():St9bad_alloc

Abort


我重新检查了那些指针;我发现我不能减小它们的大小。

我知道如何解决这个问题?
Hello everyone,

In my program, I have to define many pointers and when I want to
compile my program (in UNIX), it gives me the following error:

terminate called after throwing an instance of ''std::bad_alloc''
what(): St9bad_alloc
Abort

I rechecked those pointers; I found I cannot decrease the size of them.
Any idea how I can to solve this problem?



你是说你的编译器终止了吗?如果是这样,请询问您的编译器

供应商。


如果您正在谈论您的计划,那么您没有足够的

内存分配您要分配的任何内容。如果你不能
减少你分配的大小(或以其他方式提供足够的空间)并且不能为你的计算机增加更多的内存,那么你是
沉没。


干杯! --M

Are you saying your compiler terminates? If so, ask your compiler
vendor.

If you are talking about your program, then you don''t have sufficient
memory to allocate whatever you are trying to allocate. If you can''t
decrease the size of what you are allocating (or otherwise provide
enough space) and can''t add more memory to your computer, then you''re
sunk.

Cheers! --M


Mohsen写道:
Mohsen wrote:

大家好,


在我的程序中,我必须定义很多指针,当我想要编译我的程序(在UNIX中)时,它会给我以下错误:
终止'

what():St9bad_alloc

Abort


我重新检查了那些指针;我发现我不能减小它们的大小。

我知道如何解决这个问题?
Hello everyone,

In my program, I have to define many pointers and when I want to
compile my program (in UNIX), it gives me the following error:

terminate called after throwing an instance of ''std::bad_alloc''
what(): St9bad_alloc
Abort

I rechecked those pointers; I found I cannot decrease the size of them.
Any idea how I can to solve this problem?



如果没有看到你的代码就不可能知道发生了什么。


我不知道你是什么通过不能减小尺寸来表示。

Without seeing your code it''s impossible to tell what is going on.

I have no idea what you mean by "cannot decrease the size".


" Mohsen" < ja ******* @ gmail.comwrote:
"Mohsen" <ja*******@gmail.comwrote:

在我的程序中,我必须定义很多指针,当我想要

编译我的程序(在UNIX中),它给了我以下错误:


在抛出''std :: bad_alloc'的实例后终止调用

what():St9bad_alloc

中止
In my program, I have to define many pointers and when I want to
compile my program (in UNIX), it gives me the following error:

terminate called after throwing an instance of ''std::bad_alloc''
what(): St9bad_alloc
Abort



在编译期间,或程序运行时?


-

要给我发电子邮件,请输入sheltie在主题中。

During the compile, or while your program is running?

--
To send me email, put "sheltie" in the subject.


这篇关于在抛出'std :: bad_alloc'的实例后终止调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆