Hi, I'm a newbie in programming and I'm currently writing a simple tool in C.
This program scans all the directories in %USERPROFILE%\Documents for *.doc and *.docx files using FindFirstFile and FindNext. If the name of the file ends in *.doc or *.docx, the file name is inserted into an array of strings.
At the end of the scanning the program will use this string array to begin the copy of the files in an usb key.
In order to create a string array I use "char * * filenames;". The problem is: I don't know how many files will be present in the folder. How can I know the number of files to initialize the array? For example, if the array has 1000 strings, and the files are 10-20, I'm wasting memory; if the files are more than 1000, these won't be included. How can this be solved?