stringstream问题 [英] stringstream question
本文介绍了stringstream问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是一些代码,用来处理我的代码,但现在有问题:
Here is some code that used to work with my code, but is having a problem now:
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstring>
using namespace std;
int main()
{
stringstream out;
out << 100;
cout << out.str();
}
我只是空白输出。
推荐答案
在相同的条件下得到这个完全相同的问题雪豹64位XCode 3.2基本SDK 10.6和切换到Base SDK 10.5解决它。
Get this exact same issue under the same conditions Snow Leopard 64-Bit XCode 3.2 Base SDK 10.6 and the switch to Base SDK 10.5 resolves it.
显然它是一个SDK 10.6问题。
Apparently it's a SDK 10.6 issue.
正确的解决方法是删除预处理宏:
and the correct workaround is to remove the preprocessor macros:
- _GLIBCXX_DEBUG = 1
- _GLIBCXX_DEBUG_PEDANTIC = 1
从预处理器设置(或者回到上面的SDK 10.5)。
From the preprocessor settings (or else fall back to SDK 10.5 as above).
这篇关于stringstream问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文