sizeof(buffer) is NOT the same as test. Buffer is not an array, it's a character pointer to the beginning of an array; sizeof(buffer) is the same as sizeof(char *) which is often 4 on 32-bit computer systems.
using namespace std;
datFile.open("thps2.dat", ios::binary | ios::ate);
for(int i = 0; i < 67; i ++)
inFiles.open(fileNames[i], ios::binary | ios::ate);
test = inFiles.tellg();
buffer = new char[test];
You also should seek to the file's end *after* you open it, not before.
The rest was just making your code proper C++.