fread (pCharbuff,1,lSize,pFile);
bool spacesLeft = true;
std::string::size_type pos = 0;
while(spacesLeft)
{
pos = strString.find(" ");
Your string variable
strString
has not been initialised with the contents of the buffer read from the file.
[UPDATE]
The problem also is that you have not terminated your input data properly so the
strString(pCharbuff);
constructor is picking up garbage. Change the code as follows:
pCharbuff = (char*) malloc (sizeof(char)* (lSize + 1));
fread (pCharbuff,1,lSize,pFile);
pCharbuff[lSize] = '\0'; \\ add null terminator to end of data
std::string strString(pCharbuff);
[/UPDATE]