友元函数44 class Teacher i //前向声明 class student private: 类只有在声明之 int st data; 后才能被引用 public: v。 id gets tuddata(); friend void display(student abc, Teacher xyz)i class Teacher private: int th data; ublic void getteachdatao)i friend void display (student abc, Teacher xyz)i void display (student abc, Teacher xyz)( //某些代码 我是大家的朋友 大青鸟7 友元函数 4-4 class Teacher; //前向声明 class Student { private: int st_data; public: void getstuddata(); friend void display(Student abc, Teacher xyz); }; class Teacher { private: int th_data; public: void getteachdata(); friend void display(Student abc, Teacher xyz); }; void display(Student abc, Teacher xyz) { //某些代码 } 我是大家的朋友 类只有在声明之 后才能被引用