How do you read the files that are in the folder with the program in it?
Ala, I have a folder where there are various binaries in it with the data, and I want to access them, without having to type in the name of the file in advance.?
#include <windows.h>
#include <iostream>
#include <dirent.h>
usingnamespace std;
int main()
{
DIR *D;
struct dirent *Dirp;
D = opendir("."); //"." Refers to the project location, any path can be placed here
while ((Dirp = readdir(D))!= NULL)
{
cout << Dirp->d_name << endl;
}
system("PAUSE");
}
PS. Names without an extension are folders.
Also I would not recommend using a library for such a small task.