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