没有合适的资源?快使用搜索试试~ 我知道了~
基于C++实现读取指定路径文件
1 下载量 193 浏览量
2020-12-17
06:59:45
上传
评论
收藏 55KB PDF 举报
温馨提示
试读
2页
电脑配置:window10, 64位操作系统,基于x64的处理器,Microsoft Visual Studio Community 2019 Version 16.4.5 实现方法:使用 boost-filessystem 包。 使用 vcpkg 安装方法: .\vcpkg.exe install boost-filesystem:x64-windows 代码: #include <iostream> #include <boost> using namespace std; using namespace boost::filesystem; int mai
资源推荐
资源详情
资源评论
基于基于C++实现读取指定路径文件实现读取指定路径文件
电脑配置:window10, 64位操作系统,基于x64的处理器,Microsoft Visual Studio Community 2019 Version 16.4.5
实现方法:使用 boost-filessystem 包。
使用 vcpkg 安装方法: .cpkg.exe install boost-filesystem:x64-windows
代码:
#include <iostream>
#include <boost/filesystem.hpp>
using namespace std;
using namespace boost::filesystem;
int main()
{
//指定图片读取文件夹,然后得到文件夹下的所有图片
string pathImageFile = "e:/picture";
path pathFile(pathImageFile);
vector<string> imageFiles;
for (auto f = directory_iterator(pathFile); f != directory_iterator(); f++)
{
if (!is_directory(f->path())) // We eliminate directories
{
imageFiles.push_back(f->path().filename().string());
cout << f->path().filename().string() << endl;
}
else
continue;
}
}
运行结果:
查阅了一些这方便的中文资料,发现很少谈到要引用包的,所以这里写了下使用第三方包的方法供大家参考。另外,因为本人
资源评论
weixin_38503496
- 粉丝: 7
- 资源: 984
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功