dmoeller wrote
I am using windows 10 and microsoft visual studio compiler. if fstream requires a single file, what can I use to load a file where the name is unkown but the file extension is known? what can I use to load all files of a given extension?
You need to search the directory that contains the files. For each file that is found you need to individually process the file.
I don't have any code samples that do this in Microsoft land. The Windows API functions you want to use to list all files in a directory are FindFirstFile, FindNextFile, and FindClose.
Microsoft's "simple" (not!) example is here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365200(v=vs.85).aspxYou can search for only .vm files by changing this code
// Prepare string for use with FindFile functions. First, copy the
// string to a buffer, then append '\*' to the directory name.
StringCchCopy(szDir, MAX_PATH, argv[1]);
-- StringCchCat(szDir, MAX_PATH, TEXT("\\*"));
++ StringCchCat(szDir, MAX_PATH, TEXT("\\*.vm"));
--Mark