How can I read a directory in a c program?



How can I read a directory in a c program?..

Answer / banavathvishnu

int main(int argc,char *argv[])
{

printf("%s \n",argv[0]);
return 1;
}
will give you the path where the executable is stored.

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More C Interview Questions

What does a run-time "null pointer assignment" error mean?

2 Answers  


How can I recover the file name given an open stream?

0 Answers  


What are type modifiers in c?

0 Answers  


what is a function method?give example?

0 Answers  


What is omp_num_threads?

0 Answers  






How many types of arrays are there in c?

0 Answers  


The statement, int(*x[]) () what does in indicate?

0 Answers  


Tell about strtok & strstr functions

2 Answers   HCL, iFlex, Motorola,


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

0 Answers  


Write a program to print a (*)pattern programming (A to Z) in capital in one programming ?

2 Answers   TCS,


Explain what are header files and explain what are its uses in c programming?

0 Answers  


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

2 Answers   NIC,


Categories