Click here to Skip to main content
16,006,474 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong19-Oct-06 6:10
sahoong19-Oct-06 6:10 
AnswerRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Maximilien19-Oct-06 6:49
Maximilien19-Oct-06 6:49 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong19-Oct-06 8:08
sahoong19-Oct-06 8:08 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Maximilien19-Oct-06 8:18
Maximilien19-Oct-06 8:18 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong19-Oct-06 8:35
sahoong19-Oct-06 8:35 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
David Crow19-Oct-06 8:40
David Crow19-Oct-06 8:40 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong24-Oct-06 10:08
sahoong24-Oct-06 10:08 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
David Crow24-Oct-06 10:43
David Crow24-Oct-06 10:43 
You posted this same code three separate times. Why? Post it once and reference all others to it.

sahoong wrote:
return (tau1 - 2*m2(r2*r2/4 -h2*h2/3 -d*d)*om1*om2*sin(tetha2)*cos(tetha2) - m2*g*d*cos(tetha1)*cos(tetha2))/
(m1(ra*ra + rb*rb)/4 + m1*h1*h1/3 + m2*r2*r2(1+sin(tetha2)*sin(tetha2))/4 + m2*h2*h2*cos(tetha2)*cos(tetha2)/3 + m2*d*d*cos(tetha2)*cos(tetha2));


Have you considered breaking this up into more manageable statements? If so, you'd see that the parenthesis are not paired up. When using floating-point constants, it helps to use denote them as such (e.g., 2.0*m2, r2/4.0).

All that aside, I'm not seeing the benefit of using classes just yet. So far, calling a bunch of functions is all that's necessary.

Your code is mixing float and double. Why?


"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

"Judge not by the eye but by the heart." - Native American Proverb


GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Zac Howland19-Oct-06 9:44
Zac Howland19-Oct-06 9:44 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong24-Oct-06 10:07
sahoong24-Oct-06 10:07 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Zac Howland24-Oct-06 10:59
Zac Howland24-Oct-06 10:59 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Zac Howland19-Oct-06 8:19
Zac Howland19-Oct-06 8:19 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong19-Oct-06 9:19
sahoong19-Oct-06 9:19 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Zac Howland19-Oct-06 9:37
Zac Howland19-Oct-06 9:37 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong24-Oct-06 10:08
sahoong24-Oct-06 10:08 
AnswerRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Mike Dimmick19-Oct-06 6:58
Mike Dimmick19-Oct-06 6:58 
GeneralRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
sahoong19-Oct-06 8:07
sahoong19-Oct-06 8:07 
AnswerRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
Zac Howland19-Oct-06 8:08
Zac Howland19-Oct-06 8:08 
AnswerRe: ILLEGAL INDIRECTION - HOW CAN IT BE RESOLVED? Pin
David Crow19-Oct-06 8:35
David Crow19-Oct-06 8:35 
Questionhelp on type conversion operator overloading error... Pin
2simple19-Oct-06 5:50
2simple19-Oct-06 5:50 
AnswerRe: help on type conversion operator overloading error... Pin
Mark Salsbery19-Oct-06 6:23
Mark Salsbery19-Oct-06 6:23 
GeneralRe: help on type conversion operator overloading error... Pin
2simple19-Oct-06 6:44
2simple19-Oct-06 6:44 
GeneralRe: help on type conversion operator overloading error... Pin
Mark Salsbery19-Oct-06 6:59
Mark Salsbery19-Oct-06 6:59 
QuestionIssues with Windows Explorer & wnetaddconnection2 Pin
fred shaw19-Oct-06 4:51
fred shaw19-Oct-06 4:51 
QuestionRe: Issues with Windows Explorer & wnetaddconnection2 Pin
David Crow19-Oct-06 4:54
David Crow19-Oct-06 4:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.