Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能告诉我如何从该类的朋友函数中调用该类的私有函数
就像您将成为私人数据成员一样。只需访问它:
class A { void foo() {} // private member function friend void bar(); }; void bar() { A a; a.foo(); // access A's privates }