C++中的友元和封装
摘要:
1 1 class A 2 2 { 3 3 int m_a; 4 4 public: 5 19 friend class B;//A为B的友元类 6 5 A::A(int a) :m_a(a) {} 7 6 void SetaValue(int a) 8 7 { 9 8 m_a = a; 10 9 ... 阅读全文
posted @ 2016-04-06 17:11 真.新手上路 阅读(237) 评论(0) 推荐(0)
posted @ 2016-04-06 17:11 真.新手上路 阅读(237) 评论(0) 推荐(0)