美文网首页
重载 operator<<

重载 operator<<

作者: 王晓宇_xiaoyuwang | 来源:发表于2017-03-10 14:13 被阅读0次
#include <iostream>
class B
{
public:
    friend std::ostream& operator<< (std::ostream& os, const& B b) //No Const for iostream
    {
        os << "B's properties: " [ << properties];   
        return os;
    }
...
}
//friend better be inside class, in case of LINK error

相关文章

网友评论

      本文标题:重载 operator<<

      本文链接:https://www.haomeiwen.com/subject/qznngttx.html