这个C ++错误的意思是std :: length_error [英] What is the meaning of this C++ Error std::length_error

查看:2026
本文介绍了这个C ++错误的意思是std :: length_error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行我的程序时遇到以下错误:

 终止调用'std :: length_error'
what():basic_string :: _ S_create
中止陷阱

不能做很多没有代码,但我认为这个错误太深的代码复制所有的代码。也许我可以弄清楚,如果我明白这个错误的意思。
这是一个在错误的内存地址读取或写入的问题的标志吗?



有什么我可以做的,以获得有关问题的更多信息我的程序?

解决方案

这意味着你试图创建一个比std :: string :: max_size p>

http:// msdn。 microsoft.com/en-us/library/as4axahk(VS.80).aspx


类型为length_error的异常类
当操作产生长度大于
最大长度的
字符串时抛出。



While running my program I get this error:

terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create
Abort trap

I know that you can't do much without the code but I think that this error is too deep in the code to copy all of it. Maybe I can figure it out if I understand what this error means. Is this a sign for an issue with reading or writing at the wrong memory address?

Is there something I can do to get more information about the problem from my program?

解决方案

It means you tried to create a string bigger than std::string::max_size().

http://msdn.microsoft.com/en-us/library/as4axahk(VS.80).aspx

An exception of type length_error Class is thrown when an operation produces a string with a length greater than the maximum size.

这篇关于这个C ++错误的意思是std :: length_error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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