摘要: 今晚写代码,结构体直接=报错了,于是给结构体重载运算符,在博客园中看见一篇很好的博客,收藏啦~~~原地址:http://www.cnblogs.com/xielechuan/archive/2012/05/25/2518358.html结构体运算符重载1、定义结构体struct Currency{ int Dollar; int Cents;}2、重载IO输出操作,在结构体内部将输入操作的重载定义为友元函数重载friend ostream &operator<<(ostream &out,Currency value);在结构体外部进行具体定义ostream& 阅读全文
posted @ 2013-05-22 21:59 mengmee 阅读(351) 评论(0) 推荐(0) 编辑