引用传递。 举例:include<iostream> include<fstream> using namespace std;ofstream& function(ofstream &ofs){ return ofs;} int main(){ ofstream ofs("in.txt");function(ofs);return 0;}