<p>How do you scan a directory for folders and files in C? It needs to be cross-platform.</p>

opendir/readdir are POSIX. If POSIX is not enough for the portability you want to achieve, check
Apache Portable Runtime