腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(1863)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
1
回答
ostringstream
中断cout?
我希望将
ostringstream
的内容输出到其他流(例如std::cout)。我知道我可以使用std::
ostringstream
::str(),但我假设它在将流内容复制到一个字符串,然后进一步复制到另一个流时会有一定的开销。我发现我可以使用std::
ostringstream
::rdbuf() ()。但它破坏了std::cout,如下面测试程序的输出所示。我做错了什么吗?#include <iostream> int main(int argc, char const *a
浏览 1
修改于2017-05-23
得票数 3
回答已采纳
2
回答
ostringstream
和ends
ostringstream
message; message << "Hello world, version " << 2 /* << std::ends ???
浏览 1
修改于2009-09-02
得票数 2
回答已采纳
1
回答
std::
ostringstream
问题
我能做到oss << 1;那么为什么我不能这样做: ((std::
ostringstream
()) << 1).str() ?
浏览 5
修改于2010-02-04
得票数 4
回答已采纳
1
回答
double to string with
ostringstream
语法
我想知道为什么要写这篇文章生成一个字符串,但不是这个 (std::
ostringstream
() << speed.x).str();?
浏览 3
提问于2017-09-30
得票数 2
2
回答
从std::
ostringstream
流重定向到另一个std::
ostringstream
流
我需要将数据从某个std::
ostringstream
写入另一个std::
ostringstream
。当然,我可以使用str()函数std::
ostringstream
out; in << "just a test"; // it's just an
浏览 5
修改于2014-11-27
得票数 1
回答已采纳
1
回答
扩展
ostringstream
错误C++
namespace B {class StringStream : public virtual std::
ostringstream
/include/c++/4.1.2/iosfwd: In copy constructor 'std::basic_
ostringstream
<char, std::char_traits<char>, std::allocator<char>
浏览 1
修改于2014-12-09
得票数 0
回答已采纳
1
回答
实现一个可以接受为std::
ostringstream
流引用的no-op std::
ostringstream
流。
是否有人建议使用空std::
ostringstream
来避免使用<<传递给它的参数做任何工作?这里有两个相关的帖子-- 和,到目前为止最有希望的解决方案是,但是在测试它时 onullstream os; // std::
ostringstream
& oss = os; // error C2440: 'initializing' : cannot convert from 'onullstr
浏览 9
修改于2017-05-23
得票数 0
回答已采纳
1
回答
是否需要清除
ostringstream
流对象?
我在一个运行了很长时间的应用程序中使用一个
ostringstream
对象来打印调试信息以实现标准输出。我切换应用程序是否根据命令行arg实际打印和清除
ostringstream
对象(例如,详细标志)。当没有断言详细的开关时,我仍然写到
ostringstream
对象,但是我从来没有清除它。
ostringstream
oss; oss <&
浏览 1
提问于2017-05-01
得票数 0
回答已采纳
2
回答
CRLF行尾和
ostringstream
流
我正在尝试使用
ostringstream
来构建一个使用平台标准行尾的字符串(所以对我来说,它就是CRLF,因为我是为Windows开发的)。我尝试了以下代码:out << "line1\nline2\n"; //
浏览 0
修改于2011-03-29
得票数 5
回答已采纳
4
回答
我怎样才能释放
ostringstream
?
我有以下代码:
ostringstream
convert; // stream used for the conversionstring query= convert.str(); 我怎样才能释放
ostringstream
?
浏览 4
提问于2013-02-13
得票数 0
回答已采纳
1
回答
访问冲突-取消引用的
ostringstream
我有一个
ostringstream
对象,我正试图在其中插入一些字符,但是这个
ostringstream
对象在一个名为pOut的shared_ptr中。这是我正在尝试做的事情的一个简化版本: #include <iostream>{} 在我看来,这应该是可行的,因为下面看到的程序编译和运行没有任何问题: #include <iostream> #include
浏览 39
修改于2020-09-28
得票数 0
1
回答
试图使用vector<
ostringstream
>时编译错误
我试图编译这段代码,但是我得到了一个错误:#include <vector> std::vector<std::
ostringstream
> v; return 0;错误消息说明了无法默认构造
ostringstream
。
浏览 4
提问于2014-10-10
得票数 2
回答已采纳
1
回答
std::
ostringstream
和刷新成员函数
为什么这么多人在这样的情况下使用std::
ostringstream
对象的flush()成员函数:#include <sstream> float f = 12.345f / 100; ios << f; std::cout <<
浏览 2
修改于2012-10-22
得票数 0
1
回答
内联
ostringstream
宏已重新加载
答案是: ( std::
ostringstream
().seekp(
浏览 2
修改于2017-05-23
得票数 1
回答已采纳
1
回答
双偶奇数行为与
oStringStream
template <class TYPE> std::string Str( const TYPE & t ) {std::
ostringstream
浏览 0
修改于2014-08-20
得票数 0
回答已采纳
2
回答
Visual:"str()不是std::
ostringstream
的成员“
Xcode 6.2编译)中有一个编译器错误,我无法理解这个错误:#include<sstream> (std::
ostringstream
()<<0).str();以下版本编译:void main(...){}std::string result=(std::
ostringstream
()&l
浏览 2
提问于2015-04-20
得票数 4
回答已采纳
1
回答
basic_
ostringstream
::str悬空指针
最近,我在以下代码中发现了该漏洞:o << "some string";
ostringstream
o;throw my_exception(o.str
浏览 4
提问于2015-12-22
得票数 3
回答已采纳
2
回答
OStringStream
和命名空间问题C++
所以我想把一个整数转换成一个字符串,但是使用itoa并不是标准的,所以通过我的研究,我发现最好的方法是使用
OStringStream
。#include <iostream>#include <cstdlib> { // some cin
浏览 4
提问于2012-08-27
得票数 1
1
回答
ostringstream
operator<<很长时间了吗?
include <sstream> unsigned long long i = 0;nolove.cc:14: error: invalid operands of types ‘std::
ostringstream
我可以使用
ostringstream
来格式化这个(或类似的)类型吗?
浏览 0
提问于2011-08-29
得票数 2
回答已采纳
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
第 9 页
第 10 页
第 11 页
点击加载更多
领券