B
Bill Cunningham
#include <stdio.h>
double Sma(double *num, int val)
{
int i, res = 0;
for (i = 0; i < val; i++) {
res += num;
}
return res / (double) val;
}
int main(void)
{
double d, *p = (12.5 12 .5);
d = Sma(p, 3);
printf("%.2f\n", d);
}
p.c: In function `main':
p.c:5: parse error before numeric constant
I wrote this code and got this error. Where's the parse error? I'm not
seeing it.
Bill
double Sma(double *num, int val)
{
int i, res = 0;
for (i = 0; i < val; i++) {
res += num;
}
return res / (double) val;
}
int main(void)
{
double d, *p = (12.5 12 .5);
d = Sma(p, 3);
printf("%.2f\n", d);
}
p.c: In function `main':
p.c:5: parse error before numeric constant
I wrote this code and got this error. Where's the parse error? I'm not
seeing it.
Bill