博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
遍历文件下所有文件
阅读量:6882 次
发布时间:2019-06-27

本文共 1179 字,大约阅读时间需要 3 分钟。

1 _finddata_t file; 2  3     char* szFilePack="F:\\RTMFP\\measurement data\\ME4\\recursive2\\lossbyte\\*.txt"; 4     long lf; 5     if ((lf=_findfirst(szFilePack,&file))==-1)//==优先级较高所以要加括号,找到文件夹下面第一个符合的文件 6     { 7         cout<<"cannot find file"<
>word;25 linestream>>word;26 linestream>>word;27 lossb+=atoi(word.c_str());28 }29 lossbytes[file.name]=lossb;30 // cout<<_findnext(lf,&file)<
>x;36 int lossb=0;37 string line,word;38 ifstream infile("F:\\RTMFP\\measurement data\\ME4\\recursive2\\lossbyte\\"+string(file.name));39 istringstream linestream;40 while(getline(infile,line))41 {42 linestream=istringstream(line);43 linestream>>word;44 linestream>>word;45 linestream>>word;46 lossb+=atoi(word.c_str());47 }48 lossbytes[file.name]=lossb;49 }50 }51 }

 

转载于:https://www.cnblogs.com/xaf-dfg/p/3875728.html

你可能感兴趣的文章
jsp页面动态展示list-使用<select>和<c:forEach>标签
查看>>
html 样式之style属性的使用
查看>>
Linux 中显示所有正在运行的进程
查看>>
POJ 1753 Flip Game
查看>>
Vc控件用法总结之List Control
查看>>
[转] 【开源访谈】Muduo 作者陈硕访谈实录
查看>>
LeetCode 86. Partition List 20170612
查看>>
我的XHTML学习笔记
查看>>
单链表的增删查改
查看>>
centos7系统安装python3,pip3,django
查看>>
php观察者模式
查看>>
励志名言
查看>>
Linux基本命令 文件搜索命令
查看>>
C#点击按钮用DataGridView动态增加行、删除行,增加按钮列
查看>>
重构的信号
查看>>
如何计算团队贡献
查看>>
图片特效处理之怀旧效果
查看>>
MySQL5.7主从,单slave多master
查看>>
51nod 1304 字符串的相似度(exkmp)
查看>>
Frameset使用教程
查看>>