class jk{ int hj(fg &a) { return a; }}class fg{ friend int p(fg &l);//friend的声明 friend class jk;// friend jk::hj;// public: fg(int f,string d):a(f),s(d){}; int a; private: string s;};int p(fg &l){ cout<<l.a<<" "<<l.s;}int main(){ fg a(2,"dgsh"); p(a);}// 2 dgsh