Hi,
The error I am gettling is: no match for 'operator<<' in 'n2<<std::endl'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//...
int main()
{
Average n1(5); //holds a number
Average n2(20); //holds a number
//print average
cout<<"Average:\n\n"<<n1&n2<<endl;
//terminate program
return 0;
}
//...
double Average::operator&(Average a) //returns the average of 2 objects
{
return (n + a.n)/2;
}