Possible Duplicate:
returning multiple values from a function
I've stuck in dot with returning 2 values to stack. My task is to write a program which calculates complex numbers. Everything is fine but one thing. In function which divides numbers I want to make 2 cases:
- if number by which I divide doesn't equal 0, just divide and return result as one value.
- if number by wchich I divide EQUALS 0, I want to return 2 values.
For complex numbers I use structures (double real and double imaginary numbers). The function I use is in type of complex number structure. By function return I can only return 1 value. How can I return the second one to have on stack the same amount of numbers as before dividing? I know that I should use pointers but I still can't figure out how to use them here.