c++读取文件(C++ reads the file).docVIP

  • 91
  • 0
  • 约4.05千字
  • 约 17页
  • 2017-07-24 发布于河南
  • 举报
c读取文件(Creadsthefile)

c++读取文件(C++ reads the file) #包括“stdio. h” #包括“fstream对象。” #包括“iStream。” / /心率震荡分析参数计算----------------- / / ------------------------------------- / /坐标的计算----------------------------------- 浮get_y(int int_zero,int int_ggg,int int_adc_zengyi,int int_ybase,浮flo_ydate)/什么是Y的中线 { 浮Y; 浮动收益; 收益=(浮动)40 / int_ggg GGG一般是;/ / 409 Y = int_ybase -(flo_ydate-int_zero)*得到* int_adc_zengyi; 回到Y; } / / --------------------------------------------- / /得到参数值--------------- 浮get_dat(INT ADC,int DAT) { 浮dou_singlefudu; dou_singlefudu =(浮动)DAT / ADC; 返回dou_singlefudu; } / / --------------------------- / /打开文件------------ 无效open_read_hea() { ifstream f(“100热”,ios::in); 如果(!F. is_open()) { printf(“打开文件错误!“n); 返回; } 字符c; ofstream F2(“open_read_hea .txt”,ios::::|了iOS应用程序); 如果(!F2 is_open())。 { cout “打开文件错误!”; 返回; } 而(!F. eof()) { C = F get(); F2<c; cout C;/ /问题,文件读取结束的时候前面有两个空格 } cout “健康读出数据:完成” endl; } 无效open_read_dat() { ifstream f(“100。DAT”,iOS::在| ios::binary); 如果(!F. is_open()) { cout “打开文件101.dat错误!” endl; 返回; } ofstream F2(“open_read_dat .txt”,ios::::|了iOS应用程序); 如果(!F2 is_open())。 { cout “打开文件open_read_dat错误!” endl; 返回; } 无符号字符; int = 0; (n<60) { f.get(C); / / cout “111” endl; / / cout (int)C; F2 (int)c; cout 进制;/ /以十六进制输出数据 cout (int)C endl; 氮+; } printf(“\n DAT文件读出:完成\n”); } 无效open_read_atr() { ifstream f(“100。ATR”,iOS::在| ios::binary); 如果(!F. is_open()) { cout “打开文件100.art错误!” endl; 返回; } ofstream F2(“open_read_art .txt”,ios::::|了iOS应用程序); 如果(!F2 is_open())。 { cout “打开文件”open_read_art。 txt错误! endl; 返回; } int = 0; 无符号字符; (n<200) { f.get(C); F2 (int)c; cout (int)C endl; 氮+; } printf(“注释文件读取:完成\n”); } / /从文件中获取信息---------------------------- 无效read_hea() { 结构read_hea_firstline { 焦char_filename [ 20 ];//该文件的名称 国际int_countsingle;/ /采样信号个数 双int_pinlv;/ /频率 双dou_singlelength;/ /信号长度 }; 结构read_hea_single { 焦char_datafilename [ 20 ];//包含信号的文件名 国际char_storeformat;/ /信号格式 国际int_adczengyi;/ / ADC增益值 国际int_adcfenbianlv;/ / ADC分辨率 国际int_adczero;/ / ADC零值 双dou_firstgetpoint;/ /第一采样点 双dou_jiaoya

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档