今天遇到的bug

今天在调试代码c++的时候,遇到了两个bug。顺利的解决。


1.运行时,中断。错误提示:terminate called after throwing an instance of 'std::logic_error'
 what():  basic_string::_S_construct NULL not valid

google了一下,发现问题是,将NULL赋值给std::string变量。

参考网址:http://gcoder.blogbus.com/logs/32262907.html


2.运行时,中断。提示错误:std::out_of_range

google了一下,发现问题是,将空字符串压入到vector中的时候会出现这种错误。

参考网址:http://pingpeace.blog.51cto.com/304509/284550



ps:我的新博客地址:http://www.xinghaixu.com

posted @ 2012-05-09 22:28  成长的企鹅  阅读(116)  评论(0编辑  收藏  举报