I'm trying to create a method that takes several parameters using & (for address-of). What I'd like to do is have the method do some calculations and adjust the parameters so they can be used elsewhere.
I've defined the method as:
- (void) convertParameters: (double *)x: (double *)y: (double *)z: (double *)height: (double *)width: (double *)phi: (double *)theta: (double *)psi: (int) topLeft: (int) topRight: (int) bottomLeft: (int) bottomRight
{
...
}
What I can't figure out is how to call the method. I've been trying this:
double x, y, z, height, width, phi, theta, psi;
[self convertParameters: &x &y &z &height &width &phi &theta &psi topLeft topRight bottomLeft bottomRight];
but I get these errors from Xcode:
error: invalid operands to binary &
error: syntax error before 'topRight'
error: invalid operands to binary &
error: syntax error before 'topRight'
Earlier on I've defined topRight, etc. as: const int topLeft = 25; const int topRight = 29; const int bottomLeft = 17; const int bottomRight = 13; and they are able to be used elsewhere in the code. I'm stumped as to how to solve this.