A primitive folder listing implementation on Windows
Thous shalt not mix C/C++ unless you have a good reason to do so. Jokes aside, using pure C++ will lead more bug-free code (in terms of memory management etc.) especially since your statement


  What I've learned is to avoid using namespace std; and making the includes in alphabetical orders.


implies (to me) you are a newcomer. You're welcome, by the way. That being said, learning C way of doing things is really helpful, especially if you are not familiar with pointers etc. You will experience first hand, say why C++ smart pointers and containers are a thing.

My advice would be to study exactly why 


  You should not mix C/C++ unless you have a good reason to do so.


What you are doing with this code is nothing but plain C (except iostream methods). I did not check your code thoroughly though. So why do you want to use C++? If you want to use C++, why do you write C code and compile as C++ (again, except iostream, which can be as well stdio.h)?

Since you are using Digital Mars, for which I can't find any standard compliance information, I am not sure if you can use C++17 STL. If you can, there is a filesystem library which can be used to do what you are trying to accomplish with a few lines of code. If you can't, you can try to find a more up-to-date compiler.