/
githubmirror
/
CPlusPlusThings
Обзор
Документация
Войти
/
githubmirror
/
CPlusPlusThings
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
english/basic_content/friend/friend_func.cpp
33 строки
375 B
xliu79
english
19 июл 2020, 05:38
19 июл 2020, 05:38
2bdeea8
Код
Авторство
О чём код?
/** * @file friend_func.cpp * @brief 友元函数 * @author 光城 * @version v1 * @date 2019-08-06 */ #include <iostream> using namespace std; class A { public: A(int _a):a(_a){}; friend int geta(A &ca); ///< 友元函数 private: int a; }; int geta(A &ca) { return ca.a; } int main() { A a(3); cout<<geta(a)<<endl; return 0; }