Files
HandWritten-Analisys/测试/本机测试/2-侯-算法/handwriting/getFolders.cpp
yanshui177 962de04ffb 笔迹鉴别程序
考试的笔迹鉴别程序,分辨出不同人写的笔迹
2017-05-17 16:50:37 +08:00

39 lines
895 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* 程序名getFolders.c
功能:返回一个文件夹下的所有文件夹的名称
*/
#pragma once
#include<io.h>
#include <stdio.h>
#include<vector>
#include<iostream>
using namespace std;
#include <string.h>
int getFolders(string path, vector<string>& files )
{
using namespace std;//引入整个名空间
//文件句柄
long hFile = 0;
//文件信息
struct _finddata_t fileinfo;
string p;
int i=0;
if((hFile = _findfirst(p.assign(path).append("\\*").c_str(),&fileinfo)) != -1)
{
do
{
if(strcmp(fileinfo.name,".") != 0 && strcmp(fileinfo.name,"..") != 0)
{
files.push_back(p.assign(path).append("\\").append(fileinfo.name) );
printf("文件夹:%s\n",files[i].c_str());
i++;
}
//}
}while(_findnext(hFile, &fileinfo) == 0);
_findclose(hFile);
}
return 0;
}