#include<iostream>
using namespace std;
class distance
{private:
int feet1 ,inches1,feet2,inches2,sum1,sum2;
public:
void getdata()
{
cout<<"give the value of distance in inches and feet";
cin>>feet1>>inches1>>feet2>>inches2;
}
void add()
{sum1= feet1+feet2;
sum2=inches1+inches2;
}
void display()
{
cout<<sum1<<sum2;
}
};
int main()
{
distance x;
x.add;
x.display;
return 0;
}
I tried to write a program to add distance in feet and inches but it shows that reference to distance is ambiguous. Can someone help me out?