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

#define f(x) main() { printf("\n%d",f(2+2)); }

5 Answers  


Do pointers take up memory?

0 Answers  


What are derived data types in c?

0 Answers  


Is there any demerits of using pointer?

0 Answers  


helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe

2 Answers  


What is string function c?

0 Answers  


What is the difference between procedural and declarative language?

0 Answers  


Differentiate between a structure and a union.

0 Answers   Zensar,


What is #include conio h?

0 Answers  


what is linkage error when it occurs in c program

3 Answers  


WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............

3 Answers  


Can the “if” function be used in comparing strings?

0 Answers  


Categories