File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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: 17257
    
    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: 17257
    
    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