Thanks All, i finally got it fixed, i changed setStringValue to take char * as argument.
char *buff;
void setStringValue(char *buffText)
{
buff = new char[strlen(buffText)+1];
memset(buff, 0, strlen(buffText) +1);
memcpy(buff, buffText, strlen(buffText));
}
Note to delete the buff in the destructor of the class