|
-
October 13th, 2012, 04:34 PM
#4
Re: Linear equation/interpolation - basic compile errors
 Originally Posted by controlsguy
I am trying to create C++ code that allows a linear equation (interpolator?) to take in a value and produce an output based on a table that is specified.
The problem I am having is the GE compiler uses libraries not available in Visual studio and visa versa…
Screen shot of error…” error: expected ‘=’ ‘,’’;’’asm’…ect.
1) Use code tags when posting code. Your code is practically unreadable.
2)
Code:
double XYlim[11][11];
//...
for (j=0;j<12;j++) {
for (i=0;i<10;i++) {
cout<< XYlim[i][j] << " "; //Display the curve
}
}
What happens when j == 11? You are then accessing the array with an out-of-bounds index.
3)
Code:
goto label1; //Start program over
Get rid of this, and use proper looping constructs (while, do-while, etc.)
Regards,
Paul McKenzie
Last edited by Paul McKenzie; October 13th, 2012 at 04:36 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|