Computer/Coding
윈도우 폴더 안의 파일 경로 가져오기
순박한시골청년
2021. 1. 4. 15:04
jpg 파일만 가져왔음
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include <string>
#include <vector>
#include <io.h>
using namespace std;
int main()
{
string path = "backImg\\*.jpg";
struct _finddata_t fd;
intptr_t handle;
if ((handle = _findfirst(path.c_str(), &fd)) == -1L)
cout << "No file in directory!" << endl;
do
{
cout << fd.name << endl;
} while (_findnext(handle, &fd) == 0);
_findclose(handle);
return 0;
}
|
cs |