我用的是VC6.0   我按照书上的例题把源程序打进去,但是编译不能通过。
源程序:
#include<iostream>
using namespace std;
class Complex
{
public:
Complex() {real=0;imag=0;}
Complex(double r,double i){real=r;imag=i;}
Complex operator+ (Complex &c2);
friend ostream & operator<<(ostream &,Complex &c);
private:
 double real;
 double imag;
};
Complex Complex::operator+(Complex &c2)
{return Complex(real+c2.real,imag+c2.imag);}
ostream & operator<<(ostream & output,Complex &c)
{output<<"("<<c.real<<"+"<<c.imag<<"i)"<<endl;
return output;
}
int main()
{
Complex c1(2,4),c2(6,10),c3;
c3=c1+c2;
cout<<c3;
return 0;
}其中一个错误提示是:"real":cannot access private member declared in class "Complex"请问是哪里错了,怎么修改。谢谢