求答案,如何将文件中的数据用数组存储
现在我有一个.csv格式的数据,里面有150行,15列,现想把它存入二维数组里,请问该怎么存?谢谢
#include <stdio.h>
#define MAXROW 150
#define MAXLINE 15
main ()
{
float data[MAXROW][MAXLINE];
int i,j;
FILE *infp;
infp=fopen("/home/yanzhen/data/yzh.csv","rw");
fgets(data,MAXLINE.infp);
fclose(infp);
}
以上是我编的程序,可是运行是出错,错误信息为
Multiple markers at this line
- too few arguments to function ‘fgets’
- passing argument 1 of ‘fgets’ from incompatible pointer type
- request for member ‘infp’ in something not a structure or
union
麻烦帮我看下怎么回事,谢谢!