This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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


Win a copy of Head First Android this week in the Android forum!
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: 17271
    
    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: 17271
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invalid binary operands error in this code can any one help me please
 
jQuery in Action, 3rd edition