Defining functions outside main - problem
I am trying to define a function outside main, and the function will be used inside a loop(think thats where my probelms lie), here are the relevant bits of code. would be grateful of any help you could give me some advice/help (NB: i have attached the full code):
Code:
float f1(float Co1[10], float x3[100], int i);
int main ()
(
.....
float Co[10]; float x[100]; int i;
int result;
for(i=0;i<15;i++)
{
result= f1(Co, x, i);
coutf(x)= "<<result<<endl;
if(fabs(f1(Co,x,i))<0.00000001)
{
cout<<"The value of f(x) at the root is: "<<result<<endl;
cout<<endl;
return(0);
}
}
}
float f1(float Co[10], float x[100], int i)
{
float result;
result=((Co1[0]*x[i]*x[i])+(Co1[1]*x[i])+Co1[2]);
return(result);
}