已发送你邮箱。
/************************************************************************/
/*
读取文件
*/
/************************************************************************/
#include
#include
#include
int main()
{
FILE *fp;
int i = 0;
double sBuf[512];
//fopen 函数在visual studio 中打开文件目录要 “\\”
fp = fopen("D:\\test.txt","rb");
if (fp == NULL)
{
printf("open txt Error !\n");
return 1;
}
//printf("read success!\n");
while (fscanf(fp,"%d", &sBuf[i]) != EOF)
{
printf("%d\n",sBuf[i]);
i++;
}
fclose(fp);
return 0;
}