【发布时间】:2013-07-05 01:25:39
【问题描述】:
我正在学习C++,在用户定义的输出流操作器部分,我卡住了。 这是示例代码:
#include <iostream>
using std::cout;
using std::flush;
using std::ostream;
ostream& endLine( ostream& output )
{
return output << '\n' << flush;
}
int main()
{
cout << "Testing:" << endLine;
return 0;
}
我的问题是,在 endLine 的定义中,有一个参数。但是在main函数中,为什么它只有endLine,没有括号和相应的参数。
【问题讨论】:
-
您实际上并没有问问题。如果您没有明确提出问题,我们必须猜测您想要解释的内容。
标签: c++