How can I read a directory in a C program?

Answers were Sorted based on User's Feedback



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

Answer / sathish

In Linux/Unix , we have the header file dirent.h.This .h
file contains the direcory manipulation functions Some of
the functions are opendir,closedir,readdir.

Is This Answer Correct ?    7 Yes 1 No

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

Answer / hussain reddy

#include<stdio.h>
void main()
{
printf("%s",_agrv[0]);
}

Is This Answer Correct ?    2 Yes 9 No

Post New Answer

More C Interview Questions

What will be the output of the following program #include<stdio.h> void main() { int i=20; i-=i+++++i++; printf("%d",i); }

5 Answers  


Write a C program in Fibonacci series.

0 Answers   iNautix,


What does. int *x[](); means ?

0 Answers   Wilco,


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

0 Answers   Google,


Can you add pointers together? Why would you?

0 Answers  






How does C++ help with the tradeoff of safety vs. usability?

1 Answers  


write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"

2 Answers  


Write a program to find minimum between three no.s whithout using comparison operator.

4 Answers   IBM,


State the difference between x3 and x[3].

0 Answers   Aricent,


plz answer.. a program that takes a string e.g. "345" and returns integer 345

4 Answers  


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

0 Answers  


Can an array be an Ivalue?

0 Answers   EXL,


Categories