08-10-2010 08:00 AM - edited 08-10-2010 08:02 AM
I dont understand what you meant. sry."different declarations of your function"??? But the whole prgrm in the "square.c" worked successfully as a seperate win32 console application.
sry for the hard to read attachment. u could see it better if you download n open n zoom&view.
08-10-2010 08:13 AM
1) in square.h you have a function square ( double x);
2) in square.c your function is square ( int argc, char * argv [] )
Obviously this is the same function name but with different parameters...
Probably in your C code it should read main () instead of square ()...
08-10-2010 08:42 AM
Does that mean i have to change
double square(int argc, char* argv[]);------> main(double x);
in square.c file??
08-10-2010 08:49 AM
just to remind you: this is a forum on CVI, not on learning C. Once in a while you might want to consult your C book or the link I've posted earlier...
This said, if you are trying to compile a program, you will need a main (int argc, char* argv[]).
Within this main, you may call functions such as your square ( ).
08-11-2010 07:25 AM
ok... sorry for the inconvienence. I ll now try to figure it out by brushing up my C knowledge...
thankyou vry much
08-12-2010 06:32 AM
I tried to modfiy it. Now the compiling is ok. But when i call the function squaren in the main program, there comes error in egtting value from the control. I need to get values of period and amplitude from the uir control. I use the following command for it:
double *pt_p; double *pt_a; pt_p = &p; pt_a = &a; GetCtrlVal ( panelHandle, PANEL_NUMERIC_2, pt_p ); GetCtrlVal ( panelHandle, PANEL_NUMERIC_1, pt_a ); //double x; // Period and amplitude. const double period = (p/2); double amplitude = a ;
pt_p,pt_a are the values obtained from uir control and they are assigned to p and a . Is that correct???