Why do we even mention friend functions inside a class?

前端 未结 0 1367
既然无缘
既然无缘 2021-02-04 18:17
class c
{
public:
    int r;
    int i;
    c(int a = 1, int b = 2)
    {
        r = a;
        i = b;
    }
    friend c operator+(c c1, c c2);...........(1)
};

c ope         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题