istreambuf_iterator::operator*

取消引用运算符的返回流中的下一个字符。

CharType operator*( ) const;

返回值

流中的下一个字符。

示例

// istreambuf_iterator_operator_deref.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream>

int main( )
{
   using namespace std;

   cout << "Type string of characters & enter to output it,\n"
      << " with stream buffer iterators,(try: 'I'll be back.')\n"
      << " repeat as many times as desired,\n" 
      << " then keystroke ctrl-Z Enter to exit program: ";
   istreambuf_iterator<char> inpos ( cin );
   istreambuf_iterator<char> endpos;
   ostreambuf_iterator<char> outpos ( cout );
   while ( inpos != endpos )
   {
      *outpos = *inpos;   //Put value of outpos equal to inpos
      ++inpos;
      ++outpos;
   }
}
  我将返回。

FakePre-2c7bcba8b73c43d88295b74a24698321-e73bb1a8408243fead336b847b13399b

要求

头文件: <iterator>

命名空间: std

请参见

参考

istreambuf_iterator 类

标准模板库