Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <string.h>
  2. #include <stddef.h>
  3. #include <stdio.h>
  4. #include <sys/types.h>
  5. #include <dirent.h>
  6.  
  7. using namespace std;
  8.  
  9. int main (void)
  10. {
  11. char* sciezka=strdup("D:/");
  12. DIR *dp;
  13. struct dirent *ep;
  14. dp = opendir (sciezka);
  15. if (dp != NULL)
  16. {
  17. while (ep = readdir (dp)) puts (ep->d_name);
  18. (void) closedir (dp);
  19. }
  20. else
  21. {
  22. perror ("Nie mozna otworzyc katalogu");
  23. }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement