Explain how do you list files in a directory?



Explain how do you list files in a directory?..

Answer / Neeraj Kashyap

To list files in a directory, you can use functions like opendir(), readdir(), and closedir() in C. You open the directory using opendir(), read each file entry using readdir(), and close the directory using closedir(). The readdir() function returns a struct dirent containing information about the current file entry.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are macros in C?

2 Answers  


while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know.

1 Answers   TCS,


what is d pitfalls of registers variables

3 Answers   TCS,


write a program for size of a data type without using sizeof() operator?

22 Answers   HCL, IBM,


int a=1,b=2,c=3; printf("%d,%d",a,b,c); What is the output?

14 Answers   Verifone,


what are enumerations in C

1 Answers   TCS,


What are the different types of storage classes in C?

3 Answers  


What are the 4 types of organizational structures?

1 Answers  


Is it possible to run using programming C for Java Application?

2 Answers   NIC,


How can variables be characterized?

1 Answers  


what is answer for perfect number????????????????

1 Answers  


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

1 Answers  


Categories