Finding a directory, and printing whats in it
I am trying to write a C program that receives the name of a directory, and then prints all the files and directories under that directory.
I am having a really hard time doing this. I have gotten my program to receive the string of which directory to find, but I am not sure how to display everything.
I've looked around on the web, and found the dirent.h. But I am not sure how to use those functions, or even if they are the ones I should be using. sys/types.h is another one that I have been looking into as well.
This program shouldn't be hard for me, but for some reason I just can't figure it out.
Anybody out there have any advice or help to offer me?
Thanks ahead of time.