Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char *fileName(char * file){
- char* filepath = (char*)malloc(sizeof(char )*100);
- DIR * d = opendir(file);
- struct dirent *dir;
- int i =0;
- if(d){
- while((dir = readdir(d))!= NULL){
- if(!strcmp(dir->d_name,".") || !strcmp(dir->d_name,"..")){
- }
- else{
- while(dir->d_name != NULL){
- strcpy(filepath[i],dir->d_name);
- i++;
- }
- }
- }
- }
- return filepath;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement