I have removed all the unwanted segments. I am trying to pass pointers to an overloaded operator and use templates too. But this is still not working.
#include<iostream.h>
#include<conio.h>
class Test{
private:
int a;
public:
Test (){}
Test(int k){
a=k;
}
Test* operator +(Test *p){
Test *temp=new Test(this->a+p->geta());
return temp;
}
int geta(){
return a;
}
};
template<class T>
T* sum(T* a,T* b){
return a+b;
}
int main(){
Test *t1,*t2;
t1=new Test(5);
t2=new Test(7);
Test *z=sum(t1,t2);
cout<<z->geta();
getch();
}