I'm fairly new to C. I've tried googling but haven't found anything. Can anyone direct me to some relevant functions or readings or whatever that might help with this problem? Basically I need to be able to give a directory as an argument and it needs to be able to count the number of files and directories. Not sure where to start.

Thanks in advance for any help!

You start by reading the manual/text. Then you try writing some code. Maybe take a look around the net with Google. Maybe actually use the search facility at Daniweb (look in the top right corner). I got on hit at Daniweb about 30 or so from the top of a search list directory in C (It didn't limit the search to the C forum, though) and another at stack overflow (always a good resource for programming issues) via Google as the forth hit. Daniweb was third.

After you've got some code written, then if you can't get it working, or working right, you come here and post a question. Use the CODE button when you post your question with your code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.