注册 登录
编程论坛 C++教室

运算符>>重载,在线求助

hanpengqd 发布于 2008-11-15 19:33, 818 次点击
输出运算符重载<<有格式:
std::ostream & operator<<(std::ostream & os,const Class & t);
输入运算符怎么重载啊???应该返回个类么,参数怎么设置啊?
在线求助,大家帮帮忙吧
4 回复
#2
hanpengqd2008-11-15 21:03
顶一下,帮忙看看啊
#3
shediao2008-11-15 21:25
[qq]562538312[/qq]
ostream & operator <<(ostream & out,Class const &){
              ...................
             return out;
}
#4
sunkaidong2008-11-15 21:55
同意楼上,最好不要用6.0
#5
hanpengqd2008-11-17 14:18

是要重载输入操作符>>啊
不是<<这个
1