复制一个istringstream [英] copy an istringstream

查看:53
本文介绍了复制一个istringstream的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

/ *将一行代码一行复制到输出中* /

副本(istream_iterator< string>(iss),

istream_iterator< string>() ,

ostream_iterator< string>(oss,""));


这句话的含义是什么?谢谢!

/*Copy the line a token at a time into the output*/
copy(istream_iterator<string>(iss),
istream_iterator<string>(),
ostream_iterator<string>(oss, " "));

What''s the meaning of this statement? Thanks!

推荐答案



" dover" <做***** @ close.com>在留言中写道

news:g1 ********************* @ bgtnsc04-news.ops.worldnet.att.net ...

"dover" <do*****@close.com> wrote in message
news:g1*********************@bgtnsc04-news.ops.worldnet.att.net...
/ *一次将一个标记行复制到输出* /
副本中(istream_iterator< string>(iss),
istream_iterator< string>(),
ostream_iterator< string>(oss,""));

这句话的含义是什么?谢谢!
/*Copy the line a token at a time into the output*/
copy(istream_iterator<string>(iss),
istream_iterator<string>(),
ostream_iterator<string>(oss, " "));

What''s the meaning of this statement? Thanks!




再次作为您之前的帖子,评论为您提供答案。复制算法

有三个参数 - 前两个是开始的,一个是结束的

源范围的迭代器和第三个参数是开始
$ b目标范围的$ b迭代器。

所以你的源范围是一个istringstream(字符串可以表现为外部的b / b
设备到流。)你的目的地是一个带有空格的ostringstream

分隔符。

因此,如果输入流包含This is a test,然后目标字符串将

还包含这是一个测试。


-Sharad



Again as your previous post the comment gives you the answer. copy algorithm
takes three parameters - the first two are beginning and one past the end
iterators of the source range and the third parameter is the beginning
iterator of the destination range.
So your source range is a istringstream (strings can behave as external
devices to streams.) Your destination is an ostringstream with space as the
delimiter.
So if input stream contains "This is a test" then destination string will
also contain "This is a test".

-Sharad


dover写道:
dover wrote:
/ *一次将令牌一行复制到输出* /
副本(istream_iterator< string>(iss),
istream_iterator< ; string>(),
ostream_iterator< string>(oss,""));

这句话的含义是什么?谢谢!
/*Copy the line a token at a time into the output*/
copy(istream_iterator<string>(iss),
istream_iterator<string>(),
ostream_iterator<string>(oss, " "));

What''s the meaning of this statement? Thanks!




它一次将令牌一行复制到输出中。



It copies the line a token at a time into the output.


dover写道:
/ *一次将一个标记行复制到输出* /
副本(istream_iterator< string>(iss),
istream_iterator< string>() ,
ostream_iterator< string>(oss,""));

这句话的含义是什么?谢谢!
/*Copy the line a token at a time into the output*/
copy(istream_iterator<string>(iss),
istream_iterator<string>(),
ostream_iterator<string>(oss, " "));

What''s the meaning of this statement? Thanks!




其他人已经回答了这个问题。我想向小组提出一个奖金问题

:这个陈述的含义是什么?


vector< string> vec(istream_iterator< string>(iss),

istream_iterator< string>());


-

Russell Hanneken
eu*******@cbobk.pbz

使用ROT13解码我的电子邮件地址。



Others have answered this question. I''d like to pose a bonus question
to the group: what''s the meaning of this statement?

vector<string> vec( istream_iterator<string>(iss),
istream_iterator<string>() );

--
Russell Hanneken
eu*******@cbobk.pbz
Use ROT13 to decode my email address.


这篇关于复制一个istringstream的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆