Please use code tags otherwise this program is hard to read and don't post parts oif it. Post the entire program and run it through gdb to see the erroneous line.
No CODE TAGS [ c o d e] ... [ / c o d e ] without spaces. -- jim mcnamara
#include<stdio.h>
#include<string.h>
#include <math.h>
main (int argc, char **argv)
{
char Buf[200],SEQ[100];
int i,n;
double x[], mean,result = 0;
FILE *fp;
fp=fopen(argv[1],"r");
while(fgets(Buf,20,fp))
{
sscanf(Buf,"%s",SEQ);
x=getc(SEQ);
}
fclose(fp);
{
for (i = 0; i < n; i++) result += x;
result /= n;
return result;
printf("%f", result);
}
}
output of this program
mean.c: In function �main�:
mean.c:11: error: array size missing in �x�
mean.c:17: warning: passing argument 1 of �_IO_getc� from incompatible pointer type
mean.c:17: error: incompatible types in assignment