#include<iostream>
using namespace std;
class name
{
int x,y;
public:
name(int a, int b) { x=a; y=b; }
name operator + (name const &obj){
name one;
one.x = x + obj.x;
one.y = y + obj.y;
return res;
}
void print(){
cout<<"Values are: "<<x<<","<<y<<endl;}
};
int main()
{
name c1(4,4),c2(6,6);
name c3=c1+c2;
c3.print();
return 0;
}
This displays error: [Error] no matching function for call to 'name::name()'
Could anyone tell me what is wrong with the code?