Advertisement
Agus_Darmawan

fread_diluar_while

Sep 10th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <dirent.h>
  3.  
  4. int main(void){
  5.     struct dirent *de;
  6.  
  7.     DIR *dr = opendir(".");
  8.     if(dr == NULL){
  9.         printf("Tidak bisa membuka direktory sekarang!\n");
  10.         return 1;
  11.     }
  12.  
  13.  
  14.     while((de = readdir(dr)) != NULL){
  15.         printf("%s\n",de->d_name);
  16.     }
  17.     closedir(dr);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement