可以作为返回类型,比如
#include <iostream>
#include <string>
using namespace std ;
istream& fun (istream &ios, string s)
{
ios >> s ;
cout << "the content of s: " << s << endl ;
return ios ;
}
int main ()
{
string ss ;
fun (cin, "hello") >> ss ;
cout << "the content of ss:" << ss << endl ;
return 0 ;
}