I am using standard file-handler API to read the file , currently I have used a char*
buffer to read the data, but I want to use string
so I can avoid calloc()
use. I tried to pass the string address to the ReadFile()
function, but it's not working. Could you please help me???
l_FileHandle = CreateFileA(inputFilePath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
l_FileSize = GetFileSize(l_FileHandle, NULL);
char * l_FileBuffer = NULL;
l_FileBuffer = (char *)calloc(l_FileSize, sizeof(char));
ReadFile(l_FileHandle,(void *)(l_FileBuffer), l_FileSize, &lpNumberOfBytesRead, lpOverlapped);