B
Bill Cunningham
I had this acg.c program working before now it won't even compile into
an obj file. I know because of the compiler's error reporting it's in the
return but it looks fine to me. Can I get a hint?
#include <stdio.h>
#ifdef STD
#include <stdlib.h>
#endif
double Avg(double *, int);
double Rsi(double, double);
The shared header.
#include "ta.h"
double Avg(double *num, int n)
{
double sum = 0.0;
int i;
for (i = 0; i < n; ++i)
sum += i[num];
return num / n;
}
The source file. And lastly the error.
avg.c: In function `Avg':
avg.c:9: invalid operands to binary /
Bill
an obj file. I know because of the compiler's error reporting it's in the
return but it looks fine to me. Can I get a hint?
#include <stdio.h>
#ifdef STD
#include <stdlib.h>
#endif
double Avg(double *, int);
double Rsi(double, double);
The shared header.
#include "ta.h"
double Avg(double *num, int n)
{
double sum = 0.0;
int i;
for (i = 0; i < n; ++i)
sum += i[num];
return num / n;
}
The source file. And lastly the error.
avg.c: In function `Avg':
avg.c:9: invalid operands to binary /
Bill