• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

cynchanpin

  • 博客园
  • 联系
  • 订阅
  • 管理

View Post

[开发工具]_[VS2010]_[vs2010的一个bug-使用stringstream时出现]


1. 注冊Microsfot之后想提交bug, 发现有这个提示, 所以提交不了bug, 有能提交的提交下吧.

You are not authorized to submit the feedback for this connection.


2. VS2010 sp1的bug, temp为居然为空.


TEST(test_Aa,StringStream)
{
	std::stringstream ss;
	ss << 0;
	const char* temp = ss.str().c_str();
	std::cout << "temp: " << temp << std::endl;
}

这里我使用vs2010 sp1的temp输出为空, g++就正常输出为0.

vs2010:

temp:


备注: 应该是微软实现的标准库的问题, 找时间研究下. 暂时解决的方法就是先把stringstream转换为string, 再从string调用c_str()就会有值.

posted on 2017-04-17 17:03  cynchanpin  阅读(211)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3