Hi
I am playing with functions for the first time [note, I am using C, not C++, so main ( ) is OK]. Here is my program:
Code:
/* test for functions*/
#include <stdio.h>
float FUNCTION;
main ( )
{
float xi, yi, x_new, y_new, h;
xi = 1; yi = 1; h = 0.1;
y_new = yi + h * FUNCTION( xi, yi );
x_new = xi + h;
printf( "x\fy\n" );
printf( "%f\t%f\n", x_new, y_new );
}
}
float FUNCTION( float X, float Y )
{
return X + 3*Y/X;
}
The compiler returns:
line 12: Parse Error, expecting `','' or `SEP'
'y_new = yi + h * FUNCTION( xi, yi )'
aborting compile
What is wrong? (Thanks)