首页 > 其他 > 详细

VC7(VS2002)调试时 std::string 超过15字符乱码问题

时间:2015-07-29 19:23:11      阅读:417      评论:0      收藏:0      [点我收藏+]

VC7(VS2002)调试时 std::string 超过15字符乱码问题

VC8(VS2005)无此问题。



std::string str = "1234567890123456";        
const char* p    = str.c_str();
调试时:str的值是乱码,p是正确值。

可能是VS2002的bug,根源可能是:
std::string 不超过15字符保存在_Bx.Buf中,否则保证在_Bx.Ptr中。
调试时VC7总是读取的_Bx.Buf。

版权声明:本文为博主原创文章,未经博主允许不得转载。

VC7(VS2002)调试时 std::string 超过15字符乱码问题

原文:http://blog.csdn.net/he_zhidan/article/details/47131119

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!