“别名流缓冲区”是什么?我在我的回答的评论中遇到了这个术语。
在那个评论中可能意思是这样的:
ofstream file;
file.rdbuf(cout.rdbuf());
// writes to cout
file << "hello";
所以现在那里的检查无法工作:
if(&file == &cout)
// no, it doesn't
它意味着一个具有不同名称的对象,例如这个:
ostream &lbw = cout;
lbw << "Shahid out" << "Sachin in" << endl; //goes to cout!