1:采集txt文件中的数据测试程序如下:
#include "stdafx.h" #include <fstream> #include "iostream" using namespace std; int main(int argc, char* argv[]) { FILE *fp; float j; fp=fopen("c1_p1_x.txt","r"); for(int i=1;i<=105;i++) { fscanf(fp,"%f",&j); cout<<j<<endl; } fclose(fp); return 0; }
时间: 2024-10-08 14:14:52