摘要:
1、定义结构体struct Currency { int Dollar; int Cents;}2、重载IO输出操作,在结构体内部将输入操作的重载定义为友元函数重载friend ostream &operator<<(ostream &out,Currency value);在结构体外部进行具体定义ostream& operator<<(ostream &out,Currency value){ out<<"The dollar = "<<value.Dollar<<" a 阅读全文