看板 EE_DSnP 關於我們 聯絡資訊
is this ok? class A { public: void x() { } }; class B { friend void A::x(); } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.241.177
ric2k1:Yes, friendship is granted, not taken. 12/08 23:47
ric2k1:so you are correct. Now A::x() can access B's private 12/08 23:48
ric2k1:data members and member functions. 12/08 23:48
ric2k1:We will cover this in next lecture too. 12/08 23:49