View previous topic :: View next topic |
Author |
Message |
jab351c
Joined: 27 Nov 2006 Posts: 9
|
compiling error |
Posted: Sat Dec 09, 2006 10:29 pm |
|
|
Why am I getting this error? It looks like I have semi-colons everywhere that I need them. I commented the line numbers for reference.
thanks,
Jeff
*** Error 76 " Line 326(11,14): Expect ;
*** Error 76 " Line 335(72,73): Expect ;
Code: | dist=400.0;
bw=160.0;
mv=2530.0;
d=0.264;
bc=0.164;
z=300.0;
sh=-2.03;
gam=1.40;
r=8.31432;
p=0.076474;
mo=28.9644;
g=32.1734;
t=(15.0+273.15);
s=(pi/4.0)8.0*d*d/144.0; //line 326
m=bw/7000.0;
c=sqrt(gam*(r/mo)*t);
k=((p*s*bc*c)/(2.0*m));
vx=mv-(k*z/3.0);
tx=((z/3.0/mv)*(log(mv/vx)))/(1.0-(vx/mv));
angle=(0.0-(sh/12.0)+(0.5*g*tx*tx*(2.0/log(mv/vx))*(1.0-(1.0-(vx/mv))/log(mv/vx))));
vx0=mv-(k*dist/3.0);
tx0=((dist/3.0/mv)*(log(mv/vx0)))/(1.0-(vx0/mv));
drop=(sh/12.0)+dist*angle-(0.5*g*tx0*tx0*(2.0/log(mv/vx0))/log(mv/vx0)))); // line 335
lcd_putc(0x0c);
lcd_gotoxy(1,1);
printf(lcd_putc,"Drop=%f",drop);
delay_ms(2000); |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Dec 09, 2006 10:48 pm |
|
|
You can't take it literally. Just consider it to mean that you have
something wrong with the syntax on that line. Look at the "8.0".
You have no operator between it and the parenthesis.
Quote: | s=(pi/4.0)8.0*d*d/144.0; //line 326 |
The 2nd problem is not caused by the line with the error, but
instead it's the line right above it. Look for the error. |
|
|
Ttelmah Guest
|
|
Posted: Sun Dec 10, 2006 3:41 am |
|
|
I disagree that the second error is on the line above. Count the left brackets and the right brackets on the line istelf...
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Dec 10, 2006 6:23 am |
|
|
You're right. I made a little test program and thought I got an error
on the line above. But upon running the test again, it is the actual line. |
|
|
Ttelmah Guest
|
|
Posted: Sun Dec 10, 2006 8:22 am |
|
|
I wish I had a penny for every time it _was_ the 'line above'!...
Best Wishes |
|
|
|