Question: An easy way to make an android calculator would be to have 3 separate edit text boxes and have the user in put a number, a function, and then another number like 3 + 3. This would make it easier for the app dev to store the number(s) and function(s) and perform a calculation.

Now... my calculator app has the ability to out put all the input real-time, the down side is that when I retrieve what's in the input box, i retrieve it as string (to make sure i include all the functions input-ed). I know how to retrieve numbers (by using int parse) but how do I retrieve the functions such as + - / \* ? (They're the main bit!! :O). Any help would me much appreciated thanks :)

Answer: 
You need to return a Complex object, not a double. 

As far as some code quality tips, you should create a constant accessor instead of making it a friend function. Also, the references should be const since you aren't modifying the inputs. And `using std` is often considered poor practice, though it's not so bad in a non-header file.

```
Complex addComplex(const Complex& a, const Complex& b)
{
  return Complex(a.real + b.real, a.imag + b.imag);
} 

```
`addComplex` should return a `Complex` object:

```
Complex addComplex(const Complex &a, const Complex &b)
{

    /*Sum the real and imaginary parts, and use the constructor*/
    return Complex(a.real + b.real, a.imag + b.imag);
}

```

I've also made the parmaeters `const` reference types. This helps program stability since it means that the function cannot modify `a` and `b`.