wood burning stoves 2.0*
The moose likes iOS and the fly likes invalid binary operands error in this code can any one help me please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » iOS
Bookmark "invalid binary operands error in this code can any one help me please" Watch "invalid binary operands error in this code can any one help me please" New topic
Author

invalid binary operands error in this code can any one help me please

Rizwan Lateef
Greenhorn

Joined: Aug 11, 2010
Posts: 7
-(float *) angleInRadians{
int *n = numberOfSides;
float *result = ((n - 2) * 180);
result /= numberOfSides;
float *angle = (result * (M_PI / 180));
return angle;
}
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

int and float are not pointer object types, you should remove the "*"

int n = numberOfSides;
float result = ((n - 2) * 180);

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

To do it all for you

-(float) angleInRadians{
int n = numberOfSides;
float result = ((n - 2) * 180);
result /= numberOfSides;
float angle = (result * (M_PI / 180));
return angle;
}

Mark
 
GeeCON Prague 2014
 
subject: invalid binary operands error in this code can any one help me please