Code:

#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
const int N=100;
class A
{
private:
int ar[N];
public:
A();
friend istream& operator>>(istream&,A &);
friend ostream& operator<<(ostream&,A &);
A& operator+(A &);
friend A operator-(A &,A &);
};
A :: A()
{
int i;
for(i=0;i<N;i++)
ar[i]=0;
}
istream& operator>>(istream& in,A &a)
{
int i;
for(i=0;i<N;i++)
in>>a.ar[i];
return in;
}
ostream& operator<<(ostream& out,A &a)
{
int i;
for(i=0;i<N;i++)
out<<a.ar[i];
out<<endl;
return out;
}
A& A :: operator+(A &a)
{
A a1;
int i=0;
cout<<"inside operator+.."<<endl;
for(i=0;i<N;i++)
a1.ar[i] = a.ar[i];
for(i=0;i<N;i++)
cout<<a1.ar[i]<<" ";
cout<<a1;
return a1;
return a1;
}
int main()
{
A a,b,c;
cout<<"Enter ...";
cin>>a>>b;
cout<<"You entered...";
cout<<a<<b;
cout<<"Arithmetic"<<endl;
c = a + b;
cout<<endl;
cout<<"After adding : "<<c<<endl;
getch();
return 0;
}

And the problems r.........

reference from a local variable 'a1' returned........

i know that the scope of variable dies once the control lands outside the function............

but as it is required to return the object......i don't get it .......

how to do that?

please help.......