[c++ question] winAPI
by FiveSix - November 24, 2021 at 06:46 PM
#1
did some looking into winAPI to find a way to make a c++ program get a list of directorys and sub-directorys and store them for later use. i stumbled across std::filesystem and was looking around and found recursive-directory-iteration. i was wondering if anyone could help me understand how to make something like this and how it works. thank you in advance!

FiveSix

note (im not asking you to bend me over and write the shit for me i just need a few pointers and someone who can explain it better than some half witted retard on youtube)
Reply
#2
Quite simple actually.
You could try this

#include <dirent.h>
#include <stdio.h>

int main()
{
const char* PATH = ".";

DIR *dir = opendir(PATH);

struct dirent *entry = readdir(dir);

while (entry != NULL)
{
if (entry->d_type == DT_DIR)
printf("%s\n", entry->d_name);

entry = readdir(dir);
}

closedir(dir);

return 0;
}
Reply
#3
you got the answer on codeproject.com bro
Reply

Possibly Related Threads…
Thread Author Replies Views Last Post
Python course question lambite 1 649 November 10, 2019 at 11:52 PM
Last Post: aiwl01
Question sunfishtooth 1 736 July 23, 2019 at 09:35 AM
Last Post: tananana

 Users browsing this thread: 1 Guest(s)