How to know how many files are into a directory



Hi, I need help. I want to read text files contained into a directory, but my program is unaware of how many files are contained into.

In bash there's something similar to (figure out)

for i in <dir> do
....
done

but I don't know how to do the same in C. Can you show me snippets of code?

-- Antonio
.