int
fscanf ( FILE
*stream, const
char *format,[argument...]); |
start=clock(); while(1){ j=fscanf(fp,"%lf",&buf[cnt]); printf("j=%d fp=%d\n",j,ftell(fp)); if( j==1 ){ cnt++; }else{ //文件尾或非法字符 j=fscanf(fp,"%s",s); printf("j=%d fp=%d\n",j,ftell(fp)); if(j!=1) break; else{ ndcnt++; //printf("%s\t",s); //continue; } } count++; } fclose(fp); end=clock(); printf("文件读取所花时间:%d 毫秒\n",(end-start));
原文:http://blog.csdn.net/wrm_nancy/article/details/20474897