1.友元函数不能访问类的私有成员 这种情况是在重载流操作运算符时出现的, 和名字空间有关系。举个例子 class Test { friend istream &operator>>( istream &, Test & ); public: Test() { a = 0;} void print() { cout << a << endl;} private: int a; }; istream &operator>>( istream &input, Test &num ) { // 友元函数的声明 input >> num.a; return input; }; 2.使用getline函数要敲两次回车 3.关于截尾的。