友元函数43 class teacher private in七a public: teacher o friend int stud( teacher);没有 friend int stud(teacher tl) return(t1.a);//因为stud()是一个友元 大青鸟6 友元函数 4-3 class teacher { private: int a; public: teacher() { a = 5; } friend int stud(teacher); }; int stud(teacher t1) { return (t1.a); //因为stud()是一个友元 } 没有friend