Last active
June 15, 2018 06:50
-
-
Save cashiwamochi/ee019676bc04411450ba1eec8f2f8c22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dirent.h> | |
vector<string> readFileInDir(char* path_to_image) { | |
vector<string> paths; | |
DIR* dp=opendir(path_to_image); | |
string s_path_to_image = path_to_image; | |
if (dp!=NULL) | |
{ | |
struct dirent* d; | |
do{ | |
d = readdir(dp); | |
if (d!=NULL) { | |
string file_name = d->d_name; | |
paths.push_back(s_path_to_image + file_name); | |
} | |
}while(d!=NULL); | |
} | |
closedir(dp); | |
return paths; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
path[0]とpath[1]には,"your_path/."と"your_path/.."が入る( どの環境でも? )