Bill Cunningham wrote:
>
>
> I compiled the file from the previous part of this thread into and
> object file. And wrote this code and got this error.
>
> #include <stdio.h>
>
> main() {
> double d=Sma(12 12.5 0.5,3);
> printf("%.2f\n",d);
> }
>
> p.c: In function `main':
> p.c:4: parse error before numeric constant
>
> something is wrong.
>
> Bill
>
>
It should look something like this:
int main() // requires the 'int' return type
{
double vals[] = {12.0, 12.5, 0.5};
double d = Sma(vals, 3);
printf("%.2f\n", d);
return 0;
}