Probably, this would work:
#include <stdio.h>
#include <string.h>
#include <dir.h>
int main()
{
struct ffblk f_info;
int finish = findfirst("*.exe", &f_info, FA_RDONLY| FA_ARCH);
for(; finish == 0; finish = findnext(&f_info));
{
char* extension = NULL;
if ((!(f_info.ff_attrib & FA_DIREC)) &&
(extension = strchr(f_info.ff_name,'.') + 1) != NULL)
{
if (!strcmp(extension,"txt") || !strcmp(extension,"html"))
printf("%s\n",f_info.ff_name);
}
}
}</dir.h></string.h></stdio.h>
Here's the
link[^] to the findfirst, findnext functions documentation
That's all. If it works, just let me know.