Original Post
Here's the deal. For my RPG I have created an NPC class, which has has a function for reading in all needed info from a single file. So basically I have a folder with a bunch of text files, one for each NPC. Now, to make an array of NPCs I need to first count all of the files in this folder and make the array that big and then open them up one by one and read in the stuff. Reading the data is no problem, however, I don't want to to code in which files to open. Basically, all you should have to do to add a new NPC is a create a file in that folder and it should be loaded automatically. So how do I count all files in a single folder and then open them all up one by one? Hope you get my drift.