Thursday, July 9, 2009

Error message in C++ Builder?

int i;


long lx,ly, lz;


float fz,x,y;


void cordic();





x=1.0;


for (i=0; i%26lt;CBIT; i++)


{


lx = x*MBIT;


ly = y*MBIT;


lz = 0;


cordic(lx,ly,lz);


fz = (float)lz/MBIT;








/* CORDIC m=1, y--%26gt;0 */





void cordic(x,y,z)


long *x, *y, *z;


{


int i;


long xx, yy, zz;





for(i=0; i%26lt;CBIT ; i++)


{





if( *y%26gt;=0)


{


xx = *x + (*y%26gt;%26gt;i);


yy = *y - (*x%26gt;%26gt;i);


zz = *z + constbl[i];





}


else


{


xx = *x - (*y%26gt;%26gt;i);


yy = *y + (*x%26gt;%26gt;i);


zz = *z - constbl[i];


}


*x = xx;


*y = yy;


*z = zz;





}





}





i keep getting error message that`s said "There`s an extra parameters when calling CORDIC function

Error message in C++ Builder?
This isn't the entire program, and due to that fact I cannot compile it and run it for you since there numerious amounts of syntax errors such as the one where CBIT and MBIt are not declared...anyway, personally what I belive the problem is...





here is your function prototype





void cordic();





Here is your function call


cordic(lx,ly,lz);





here is your function definition


void cordic(x,y,z)





If you don't know what is going on, you seriously need to read a chapter on functions, not to be mean but this is somewhat of a simple thing to fix. You need to have the SAME number and SAME order and SAME parameters in the function call, function call, and function definition. here is an example of the 3 above





//function prototype


void cordic(x,y,z);


//function call


cordic(x,y,z);


//function definition


void cordic(x,y,z)


{


//code here


}





Since I am unable to compile the program as you wrote it, I cannot tell you if there are any more logic or syntax errors.








P.S. its called a compiler, not a builder.

anemone

No comments:

Post a Comment