Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dirent.h>
- #include <stdio.h>
- #include <vector>
- #include <string>
- #include <iostream>
- #include<fstream>
- using namespace std;
- std::vector<std::string> fileName;
- int main(void)
- {
- char* appdata = getenv("APPDATA");
- char* dalje = getenv("APPDATA");
- DIR *d;
- struct dirent *dir;
- vector<string> fileList;
- int i=0;
- d = opendir(appdata);
- if (d)
- {
- while ((dir = readdir(d)) != NULL)
- {
- i++;
- fileList.push_back(dir->d_name);
- }
- for(int i=0;i<fileList.size();i++) {
- cout<<fileList[i]<<endl;
- }
- closedir(d);
- }
- system("pause");
- }
- // #include <stdlib.h>
- // #include <stdio.h>
- // int main(int argc, char** argv){
- // char* appdata = getenv("APPDATA");
- // printf("Appdata: %s\n",appdata);
- // return 0;
- // }
Add Comment
Please, Sign In to add comment