SEE DIRECTORIES IN TURBO C ++ 3.2

0

I have a code that creates directories  but the problem is that I do not find the program to read it, any idea of how it would be?

    
asked by Andrea Montserrat 24.11.2018 в 22:28
source

1 answer

0

You can use the dirent.h (POSIX) library, its implementation would be something like this:

#include <sys/types.h>
#include <dirent.h>

DIR* dirp = opendir("."); // Aquí sería el directorio a mostrar
struct dirent * dp;
while ((dp = readdir(dirp)) != NULL) {
    printf("%s", dp->d_name);
}
closedir(dirp);

You can see other methods or techniques in link

    
answered by 24.11.2018 в 23:01