Quote
#include <dirent.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
DIR *searchPath = nullptr;
struct dirent *readPath = nullptr;
string pos;
while(true)
{
getline(cin, pos);
searchPath = opendir(pos.c_str());
if(searchPath == nullptr) return 0;
while (readPath = readdir(searchPath))
{
if(readPath == nullptr) return 0;
cout << readPath->d_name << endl;
}
}
}
Want to be able to += the string so it can further search the folders.
This post was edited by sylz1014 on Dec 27 2013 10:35pm