How can I convert a char field to a string if I have the '\ 0' character stored in some position. For example, if I have "ab \ 0bb", the a.lenght () command will show me that I have only two characters stored
string getString(char *str, int len)
{
str[len] = '\0';
string strBuffer = string(str);
cout << strBuffer.length() << endl;
return strBuffer;
}