Im trying to go through a folder and read all files inside the folder. Reading in one specific file is not a problem, but I cant seem to find a good solution for reading all the files. I have been searching and havent found anything that worked. So, how would i be able to load all files? The code that i have now:
DIR *dir;
struct dirent* lsdir;
dir = opendir("C:\\Users\\Utilizador\\Desktop\\La voz de galicia\\Voz\\Nova pasta");
while ( ( lsdir = readdir(dir) ) != NULL )
{
printf ("%s\n", lsdir->d_name);
char tes[260];
strcpy(tes,lsdir->d_name);
FILE *f = fopen(tes,"r");
if(f==NULL){printf("erro");}
fclose(f);
}