示例代码...
const int SIZEOFFILENAMES = 100;
string fileNames[SIZEOFFILENAMES];
int main () {
string inFilePath;
cout << "Specify the file path:" << endl;
cin >> inFilePath;
ifstream inFile;
// open in binary
inFile.open(inFilePath.c_str(), ios::binary);
inFile.seekg(0, ios_base::end);
int fileLen = inFile.tellg();
inFile.seekg(0, ios_base::beg);
char charArr[10000];
inFile.read(charArr, fileLen);
inFile.close();
inFile.clear(ios_base::goodbit);
伪代码将是。
检查文件名数组元素大小。
将 inFilePath 附加到 Next Free 元素。
}