Dave's answer is absolutely correct, however a better solution to the problem would be
CFile* pFile = new CFile(filePathAndName, CFile::modeRead);
ULONGLONG dwLength = pFile->GetLength();char* buffer = new char[(int)dwLength + 1]; buffer[dwLength] = 0; UINT nActual = pFile->Read(buffer, dwLength);
This will allow you to use the file contents with any C++ function as a normal string