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

Is there a way to compare two structure variables?

0 Answers  


What's the difference between calloc() and malloc()?

4 Answers  


What is the advantage of a random access file?

0 Answers  


can we define a function in structure?

2 Answers  


int j =15,i; for (i=1; 1<5; ++i) {printf ("%d%d ",j,i); j = j-3; }

2 Answers  






What does c mean in standard form?

0 Answers  


Explain 'bit masking'?

0 Answers   EXL,


Is void a keyword in c?

0 Answers  


what is the difference between definition and declaration? give me some examples.

2 Answers   TCS,


Explain do array subscripts always start with zero?

0 Answers  


String concatenation

2 Answers  


what is the mean of c languages.

1 Answers   Polaris,


Categories