Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "dirent.h"
- #include <iostream>
- bool main() {
- DIR *dir;
- struct dirent *ent;
- if ((dir = opendir ("c:\\")) != NULL) {
- /* print all the files and directories within directory */
- while ((ent = readdir (dir)) != NULL) {
- printf ("%s\n", ent->d_name);
- }
- closedir (dir);
- } else {
- /* could not open directory */
- perror ("");
- return EXIT_FAILURE;
- }
- system("pause");
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement