0

Hi,

Could anyone explain me above error?

```
// friend overload + operator function
#include<iostream>
using namespace std;
class Distance
{
private:
int feet;
float inches;
public:
Distance() { feet = 0; inches = 0.0; }
Distance(float f)
{
feet=int(f);
inches = 12*(f-feet);
}
Distance(int ft, float in)
{
feet = ft;
inches = in;
}
void showdist()
{
cout << feet << "\'-" << inches << "\"";
}
friend Distance operator+(Distance, Distance);
};
Distance operator+(Distance d1, Distance d2)
{
int f=d1.feet + d2.feet;
float i=d1.inches + d2.inches;
if (i>12.0)
{ f++; i-=12.0; }
return Distance(f,i);
}
int main()
{
Distance d1=2.5;
Distance d2=1.25;
Distance d3;
cout << "d1 = "; d1.showdist();
cout << "d2 = "; d2.showdist();
d3=d1+10.0;
cout << "d3 = "; d3.showdist(); // distance + float
d3=10.0+d1;
cout << "d3 = "; d3.showdist(); // float + distance
return 0;
}
```

After compile above sample code, I get the following error. `fatal error C1001: INTERNAL COMPILER ERROR`

May be I am a beginner and always get an error :confused: although I run the simple code.:icon_smile: