목록friend function (1)
일상 코딩
[C++/8.12] friend function and class
1. forward declaration 전방선언 #include using namespace std; class B; // forward declaration (전방 선언) class A { private: int m_value = 1; friend void doSomething(A &a, B &b); }; class B { private: int m_value = 2; friend void doSomething(A &a, B &b); }; void doSomething(A &a, B &b) { cout
C++/따배C++ 08강 객체지향 기초
2021. 10. 26. 00:05