c++遍历某个文件夹中所有文件

mac2022-06-30  75

//filePath:存放所有文件名的txt,文件名之间用回车 //fileList:文件夹中所有文件名存放的位置 //算法:用到ifstream //用途:读取txt中所有文件名,将文件名存入fileList中 void getFilesName(const char *filePath, vector<string> &fileList) { ifstream file; file.open(filePath, ios::in); std::string strLine; while (getline(file, strLine)) { if (strLine.empty()) continue; fileList.push_back(strLine);

转载于:https://www.cnblogs.com/shixisheng/p/9184948.html

相关资源:C 遍历指定文件夹中的所有文件
最新回复(0)