• CONTEST ALERT - Experience the power of DDR5 memory with Kingston Click for details

a c progam source code needed

Status
Not open for further replies.

simplegeek

Broken In
hi

i am working on a simple home based c project. I am a beginner in this and need a c program which when invoked will give me the names of the files in the directory.

This should be accomplished by giving me the single name of the file as a variable, so i can manupulate or sort them as i want.

just a simple basic code will do.

thanks for ur time
 

cnukutti

Broken In
I really cant understand your question.
If you wanted to display all the files in the current directory, you can pass the ls command to a function called system()

Code:
#include<stdio.h>
main()
{
    system("ls");
}

If this is not what you expected, then please reframe your question.
 
Status
Not open for further replies.
Top Bottom