For some reason I can't figure out the + operator. I can do += just fine, but when I try to do +, I keep getting the address of the object instead of the value. The program is dealing with fractions and simplifying them with Euclid's algorithm (to explain the class name). The code:

Basic class definition:

Code:
```class Euclid
{
public:
//bunch of functions
...
private:
int numerator;
int denominator;
int simplify(int, int);
};```
This is +=, which works perfectly:
Code:
```Euclid &Euclid::operator +=(Euclid &fract)
{
numerator  = ((numerator * fract.denominator) + (denominator * fract.numerator));

denominator = (denominator * fract.denominator);

int gcd = simplify(numerator, denominator);

numerator = (numerator)/gcd;
denominator = (denominator)/gcd;

return *this;
}```
This is +, which sucks:
Code:
```Euclid &Euclid::operator +(Euclid &fract)
{
Euclid temp(1,1);

temp.numerator  = ((numerator * fract.denominator) + (denominator * fract.numerator));

temp.denominator = (denominator * fract.denominator);

int gcd = simplify(temp.numerator, temp.denominator);

temp.numerator = (temp.numerator)/gcd;
temp.denominator = (temp.denominator)/gcd;

return temp;
}```
And this is how they are being used in the actual program:
Code:
```	cout<<"Adding 1/2 to this fraction..."<<endl;
test = userfrac + half;
cout<<"The reduced fraction is "<< test.getnum() <<"/"<< test.getdem() <<"."<<endl;```

2. The + operator shouldn't return a reference to an object. It takes two objects and returns the sum without altering either one. As in your example this is done by creating temp to hold the result. This variable is local to your method, and will go out of scope when the function returns. You need to return the object by value.

3. Haha, that was dumb. Thanks for the help, sorry for wasting your time though.