请教C语言问题,我不知道fun函数哪里有错误,我感觉定义i和j没有错。

请教C语言问题,我不知道fun函数哪里有错误,我感觉定义i和j没有错。#include <stdio.h>
#include <stdlib.h>
#define M 14
void NONO();
void fun( char (*t)[M], int *a ,int *c)
{
*a=0;
*c=0;
int i,j;
for (i=0;i=<M;i++)
{
for (j=0;j<M;j++)
{
if (t[i][j]=='A') (*a)++;
if (t[i][j]=='C') (*c)++;
}
}

}

void get( char (*s)[M] )
{ int i, j;
for( i=0; i<M; i++ )
{ for( j=0; j<M; j++)
{ s[i][j]=65+rand()%12; printf( "%c ",s[i][j]); }
printf("\n");
}
}

main()
{ char a[M][M];
int x, y;
get (a);
fun ( a, &x,&y );
printf("A = %d C = %d\n",x,y);
NONO();
}

void NONO()
{/* 本函数用于打开文件,输入数据,调用函数,输出数据,关闭文件。 */
FILE *fp, *wf ;
int i, j, x, y ;
char a[M][M];

fp = fopen("in.dat","r") ;
wf = fopen("out.dat","w") ;
for( i=0; i<M; i++ )
{ for( j=0; j<M; j++)
{ fscanf(fp, "%c ", &a[i][j]); }
}
fun ( a, &x,&y );
fprintf(wf, "A=%d\n", x) ;
fprintf(wf, "C=%d\n", y) ;
fclose(fp) ;
fclose(wf) ;
}

*a=0;
*c=0;
int i,j;

C语言的话,一般要求,变量声明在最前面。

你看看是不是这个错误

int i,j;
*a=0;
*c=0;

这句有问题:

for (i=0;i=<M;i++)

-->

for (i=0;i<=M;i++)

温馨提示:答案为网友推荐,仅供参考