How can I read a directory in a c program?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program which returns the first non repetitive character in the string?

865


What are reserved words with a programming language?

873


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1011


What is use of pointer?

822


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1794


What is I ++ in c programming?

898


Differentiate between ordinary variable and pointer in c.

887


Why do we use null pointer?

818


Explain how can I manipulate strings of multibyte characters?

1014


Do you know what are the properties of union in c?

826


Does c have enums?

807


How is pointer initialized in c?

814


What is static identifier?

952


What is exit() function?

801


a value that does not change during program execution a) variabe b) argument c) parameter d) none

1003