如果是VS2010的话,声明为Complex类的友元应该是没有问题的,include <ostream> using namespace std;class Complex{ ...friend ostream& operator<<(ostream &os, const Complex &obj);};如果还是ostream不明确的话,在类之前加上 class Complex;ostream& operator<<(ostream &os, const Complex &ob...