"...redeclared as different kind of symbol"?

Posted by CodeNewb on Stack Overflow See other posts from Stack Overflow or by CodeNewb
Published on 2013-10-20T03:52:33Z Indexed on 2013/10/20 3:53 UTC
Read the original article Hit count: 108

Filed under:
|
#include <stdio.h>
#include <math.h>

double integrateF(double low, double high)

{
double low = 0;
double high = 20;
double delta_x=0;
double x, ans;
double s = 1/2*exp((-x*x)/2);

for(x=low;x<=high;x++)

delta_x = x+delta_x;
ans = delta_x*s;

return ans;
}

It says that low and high are "redeclared as different type of symbol" and I don't know what that means. Basically, all I'm doing here (READ: trying) is integrating from low (which I set to 0) to high (20) to find the Riemann sum. The for loop looks kinda trippy too...I'm so lost.

© Stack Overflow or respective owner

Related posts about for-loop

Related posts about syntax-error