Guest User

Untitled

a guest
Feb 11th, 2026
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. code:
  2. #include <stdio.h>
  3. #include <dirent.h>
  4. int main(int argc, char *argv[]) {
  5. DIR *dir = opendir(argv[1]);
  6. struct dirent *entry = readdir(dir);
  7. while ((entry = readdir(dir)) != NULL) {
  8. printf("%s\n", entry->d_name);
  9. }
  10. closedir(dir);
  11. }
  12.  
  13. output:
  14. Desktop
  15. Templates
  16. Videos
  17. .bash_logout
  18. .local
  19. .
  20. becomeEliteLinuxUser
  21. .cache
  22. ..
  23. Pictures
  24. .mozilla
  25. Music
  26. Downloads
  27. .face.icon
  28. .profile
  29. .config
  30. Documents
  31. Public
  32. .face
  33. .bash_history
  34. .var
  35.  
Advertisement
Add Comment
Please, Sign In to add comment