Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. char *fileName(char * file){
  2.  
  3. char* filepath = (char*)malloc(sizeof(char )*100);
  4. DIR * d = opendir(file);
  5. struct dirent *dir;
  6. int i =0;
  7. if(d){
  8. while((dir = readdir(d))!= NULL){
  9.  
  10. if(!strcmp(dir->d_name,".") || !strcmp(dir->d_name,"..")){
  11.  
  12. }
  13. else{
  14. while(dir->d_name != NULL){
  15. strcpy(filepath[i],dir->d_name);
  16. i++;
  17. }
  18. }
  19.  
  20. }
  21.  
  22. }
  23. return filepath;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement