这个是不可以的,你应该把输入输出流先转到数组中,再将数组作为函数的形参。
#include
// 下面传递引用,因为修改了流的数据,返回的也是引用,因为实现类似cout的链式表达式
// cout << x << y << " " << ... << endl; ...
template
std::istream& operator >>(std::istream &ins, CSMatrix
template
std::ostream& operator <<(std::ostream &outs, CSMatrix
// 就这样了,不懂Hi留言 啥的
// 模板没学可以先无视掉 这几句我从以前写的代码里摘的 ……
template
std::istream& operator >>(std::istream &ins, CSMatrix
{
matr.Input(ins);
return ins;
}
template
std::ostream& operator <<(std::ostream &outs, CSMatrix
{
matr.Output(outs);
return outs;
}
走内存吧,直接IO慢死你哦……